From 4319da7d9560bd30de6e44882e75a20c481caba2 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Sat, 23 Jul 2016 16:41:38 +0500 Subject: [PATCH] Device closing was moved --- noolite-cli.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noolite-cli.go b/noolite-cli.go index 6e4e1da..551c918 100644 --- a/noolite-cli.go +++ b/noolite-cli.go @@ -20,12 +20,13 @@ func sendCommand(command string, channel, value, r, g, b int) error { } n, err := noolite.DefaultNooliteAdapter() - defer n.Close() if err != nil { return err } + defer n.Close() + if command == "set" { if value != 0 { return n.SetBrightnesValue(channel, value)