From 2a264bffef0d53931e7304ead20c98d7cd5a73fc Mon Sep 17 00:00:00 2001 From: Jonarod Date: Wed, 20 Jan 2021 09:52:02 +0100 Subject: [PATCH] Inverted logic in Controllable If Action is NOT valid, then throw error. --- sonic/control.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic/control.go b/sonic/control.go index 58c5cb2..f0f44e9 100644 --- a/sonic/control.go +++ b/sonic/control.go @@ -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))