use struct for toggle endpoint
This commit is contained in:
@ -75,9 +75,7 @@ func (s *Client) SetState(selector string, state *State) ([]Result, error) {
|
||||
}
|
||||
|
||||
func (s *Client) Toggle(selector string, duration float64) ([]Result, error) {
|
||||
m := make(map[string]interface{})
|
||||
m["duration"] = duration
|
||||
j, err := json.Marshal(m)
|
||||
j, err := json.Marshal(&Toggle{Duration: duration})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user