func GetBytesPerSecond(ctx context.Context, u *unifi.Unifi) (*NetworkNumber, error) {
	sites, err := u.GetSites()
	if err != nil {
		return nil, fmt.Errorf("get sites: %w", err)
	}

	data := &NetworkNumber{}
	for _, s := range sites {
		for _, h := range s.Health {
			if h.Subsystem == "wan" {
				data.Upload += h.TxBytesR.Val
				data.Download += h.RxBytesR.Val
			}
		}
	}

	return data, nil
}
// GetBytesPerSecond returns the current rate of ppm from the WAN.
GetBytesPerSecond returns the current rate of ppm from the WAN.
// GetBytesPerSecond returns the current rate of ppm from the WAN .
func GetBytesPerSecond(ctx context.Context, u *unifi.Unifi) (*NetworkNumber, error) {
	sites, err := u.GetSites()
	if err != nil {
		return nil, fmt.Errorf("get sites: %w", err)
	}
	data := &NetworkNumber{}
	for _, s := range sites {
		for _, h := range s.Health {
			if h.Subsystem == "wan" {
				data.Upload += h.TxBytesR.Val
				data.Download += h.RxBytesR.Val
			}
		}
	}
	return data, nil
}
func GetBytesPerSecond ( ctx context . Context , u * unifi . Unifi ) ( * NetworkNumber , error ) { sites , err := u . GetSites ( ) if err != nil { return nil , fmt . Errorf ( " " , err ) } data := & NetworkNumber { } for _ , s := range sites { for _ , h := range s . Health { if h . Subsystem == " " { data . Upload += h . TxBytesR . Val data . Download += h . RxBytesR . Val } } } return data , nil }
GetBytesPerSecond returns the current rate of ppm from the WAN.
GetBytesPerSecond returns the current rate of ppm from the WAN .