Inverted logic in Controllable
If Action is NOT valid, then throw error.
This commit is contained in:
parent
1cfe7c425f
commit
2a264bffef
1 changed files with 1 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ func NewControl(host string, port int, password string) (Controllable, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c controlChannel) Trigger(action Action) (err error) {
|
func (c controlChannel) Trigger(action Action) (err error) {
|
||||||
if IsActionValid(action) {
|
if !IsActionValid(action) {
|
||||||
return ErrActionName
|
return ErrActionName
|
||||||
}
|
}
|
||||||
err = c.write(fmt.Sprintf("TRIGGER %s", action))
|
err = c.write(fmt.Sprintf("TRIGGER %s", action))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue