Rename SavedWifiNetworks() to WifiNetworks() for consistency

This commit is contained in:
wpetit 2018-09-20 11:33:51 +02:00
parent 5008dfbd56
commit 6534c51fe4
3 changed files with 6 additions and 7 deletions

View File

@ -15,7 +15,7 @@ func Example_updaterClientUsage() {
log.Fatal(err)
}
networks, err := updater.SavedWifiNetworks()
networks, err := updater.WifiNetworks()
if err != nil {
log.Fatal(err)
}

View File

@ -29,8 +29,7 @@ const (
SecurityOpen WifiSecurity = "open"
)
// WifiNetwork is a ReachRS module's saved wifi network
// Raw messages examples:
// WifiNetwork is a ReachRS module wifi network
type WifiNetwork struct {
SSID string `json:"ssid"`
Password string `json:"password"`
@ -41,8 +40,8 @@ type WifiNetwork struct {
Added bool `json:"is_added"`
}
// SavedWifiNetworks returns the ReachRS module saved wifi networks
func (u *Updater) SavedWifiNetworks() ([]*WifiNetwork, error) {
// WifiNetworks returns the ReachRS module wifi networks
func (u *Updater) WifiNetworks() ([]*WifiNetwork, error) {
var err error
var wifiNetworks []*WifiNetwork

View File

@ -21,7 +21,7 @@ func TestClientSavedWiFiNetworks(t *testing.T) {
t.Fatal(err)
}
_, err := client.SavedWifiNetworks()
_, err := client.WifiNetworks()
if err != nil {
t.Error(err)
}
@ -55,7 +55,7 @@ func TestClientCRUDWiFiNetwork(t *testing.T) {
t.Errorf("AddWifiNetwork() -> done: got '%v', expected '%v'", g, e)
}
networks, err := client.SavedWifiNetworks()
networks, err := client.WifiNetworks()
if err != nil {
t.Error(err)
}