Inverted logic in Controllable

If Action is NOT valid, then throw error.
This commit is contained in:
Jonarod 2021-01-20 09:52:02 +01:00 committed by GitHub
parent 1cfe7c425f
commit 2a264bffef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ func NewControl(host string, port int, password string) (Controllable, error) {
}
func (c controlChannel) Trigger(action Action) (err error) {
if IsActionValid(action) {
if !IsActionValid(action) {
return ErrActionName
}
err = c.write(fmt.Sprintf("TRIGGER %s", action))