remove unnecessary pointers

This commit is contained in:
Ryan Cavicchioni 2020-02-29 00:07:32 -06:00
parent fb36967670
commit cd04dd47b6
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -60,7 +60,7 @@ func (s *Client) Request(method, url string, body io.Reader) ([]Result, error) {
return nil, nil return nil, nil
} }
func (s *Client) SetState(selector string, state *State) ([]Result, error) { func (s *Client) SetState(selector string, state State) ([]Result, error) {
j, err := json.Marshal(state) j, err := json.Marshal(state)
if err != nil { if err != nil {
return nil, err return nil, err
@ -89,18 +89,18 @@ func (s *Client) Toggle(selector string, duration float64) ([]Result, error) {
} }
func (s *Client) PowerOff(selector string) ([]Result, error) { func (s *Client) PowerOff(selector string) ([]Result, error) {
return s.SetState(selector, &State{Power: "off"}) return s.SetState(selector, State{Power: "off"})
} }
func (s *Client) FastPowerOff(selector string) { func (s *Client) FastPowerOff(selector string) {
s.SetState(selector, &State{Power: "off", Fast: true}) s.SetState(selector, State{Power: "off", Fast: true})
} }
func (s *Client) PowerOn(selector string) ([]Result, error) { func (s *Client) PowerOn(selector string) ([]Result, error) {
return s.SetState(selector, &State{Power: "on"}) return s.SetState(selector, State{Power: "on"})
} }
func (s *Client) FastPowerOn(selector string) { func (s *Client) FastPowerOn(selector string) {
s.SetState(selector, &State{Power: "on", Fast: true}) s.SetState(selector, State{Power: "on", Fast: true})
} }