From 2a264bffef0d53931e7304ead20c98d7cd5a73fc Mon Sep 17 00:00:00 2001 From: Jonarod Date: Wed, 20 Jan 2021 09:52:02 +0100 Subject: [PATCH 1/2] 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)) From f43eee559ed7303f00166770d328e24178890ae9 Mon Sep 17 00:00:00 2001 From: Jonarod Date: Wed, 20 Jan 2021 10:05:33 +0100 Subject: [PATCH 2/2] Update go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 45a51a7..1f24354 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/expectedsh/go-sonic +module github.com/Jonarod/go-sonic go 1.14