Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudkucooland committed Jan 14, 2024
1 parent d1f3fab commit 9aaa0b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,17 @@ func (d *Device) SetMode(m string) error {
}

// GetWIFIStatus returns the WiFi station info
func (d *Device) GetWIFIStatus() (string, error) {
func (d *Device) GetWIFIStatus() (*StaInfo, error) {
res, err := d.sendTCP(CmdWifiStainfo)
if err != nil {
klogger.Println(err.Error())
return "", err
return nil, err
}
return string(res), nil
var ksta StaInfo
if err := json.Unmarshal(res, &ksta); err != nil {
return nil, err
}
return &ksta, nil
}

// GetDimmerParameters returns the dimmer parameters from dimmer-capable devices
Expand Down

0 comments on commit 9aaa0b6

Please sign in to comment.