firmware upgrades: minor docs and ui cleanup

This commit is contained in:
kayos@tcp.direct 2022-12-23 05:36:54 -08:00
parent 843121632d
commit d16319f2a9
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
3 changed files with 9 additions and 2 deletions

View File

@ -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`
---

View File

@ -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)

View File

@ -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"`