From d16319f2a90db586db3b024adc0436abfed18063 Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Fri, 23 Dec 2022 05:36:54 -0800 Subject: [PATCH] firmware upgrades: minor docs and ui cleanup --- README.md | 2 ++ internal/cli/update.go | 7 ++++++- vendor/github.com/amimof/huego/config.go | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d49acb..bf8fa24 100644 --- a/README.md +++ b/README.md @@ -32,5 +32,7 @@ With that being said, it should work fairly well to provide a command line inter - **port scan to find offline (no call home) bridges on LAN** - see gif above for demonstration - config will automatically save when a bridge connection is established + - **trigger firmware updates for bridge and lights manually** + - e.g: `upgrade` --- diff --git a/internal/cli/update.go b/internal/cli/update.go index 096de3a..efa8510 100644 --- a/internal/cli/update.go +++ b/internal/cli/update.go @@ -2,6 +2,7 @@ package cli import ( "context" + "strings" "time" "github.com/amimof/huego" @@ -26,7 +27,11 @@ func cmdFirmwareUpdate(br *ziggy.Bridge, args []string) error { if resp, err = br.UpdateConfig(&huego.Config{SwUpdate2: huego.SwUpdate2{CheckForUpdate: true}}); err == nil { log.Info().Msgf("response: %v", resp) } else { - log.Warn().Msgf("failed to issue update command: %v", err) + if strings.Contains(err.Error(), "devicetype") { + log.Debug().Msgf("non-consequential error response: %v", err) + } else { + log.Warn().Msgf("failed to issue update command: %v", err) + } } ctx, cancel := watchUpdateStatus(br, 5*time.Minute) diff --git a/vendor/github.com/amimof/huego/config.go b/vendor/github.com/amimof/huego/config.go index 2f2fbbb..9283119 100644 --- a/vendor/github.com/amimof/huego/config.go +++ b/vendor/github.com/amimof/huego/config.go @@ -35,7 +35,7 @@ type Config struct { // SwUpdate contains information related to software updates. Deprecated in 1.20 type SwUpdate struct { CheckForUpdate bool `json:"checkforupdate,omitempty"` - DeviceTypes DeviceTypes `json:"devicetypes"` + DeviceTypes DeviceTypes `json:"devicetypes,omitempty"` UpdateState uint8 `json:"updatestate,omitempty"` Notify bool `json:"notify,omitempty"` URL string `json:"url,omitempty"`