firmware upgrades: minor docs and ui cleanup
This commit is contained in:
parent
843121632d
commit
d16319f2a9
@ -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**
|
- **port scan to find offline (no call home) bridges on LAN**
|
||||||
- see gif above for demonstration
|
- see gif above for demonstration
|
||||||
- config will automatically save when a bridge connection is established
|
- config will automatically save when a bridge connection is established
|
||||||
|
- **trigger firmware updates for bridge and lights manually**
|
||||||
|
- e.g: `upgrade`
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/amimof/huego"
|
"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 {
|
if resp, err = br.UpdateConfig(&huego.Config{SwUpdate2: huego.SwUpdate2{CheckForUpdate: true}}); err == nil {
|
||||||
log.Info().Msgf("response: %v", resp)
|
log.Info().Msgf("response: %v", resp)
|
||||||
} else {
|
} 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)
|
ctx, cancel := watchUpdateStatus(br, 5*time.Minute)
|
||||||
|
2
vendor/github.com/amimof/huego/config.go
generated
vendored
2
vendor/github.com/amimof/huego/config.go
generated
vendored
@ -35,7 +35,7 @@ type Config struct {
|
|||||||
// SwUpdate contains information related to software updates. Deprecated in 1.20
|
// SwUpdate contains information related to software updates. Deprecated in 1.20
|
||||||
type SwUpdate struct {
|
type SwUpdate struct {
|
||||||
CheckForUpdate bool `json:"checkforupdate,omitempty"`
|
CheckForUpdate bool `json:"checkforupdate,omitempty"`
|
||||||
DeviceTypes DeviceTypes `json:"devicetypes"`
|
DeviceTypes DeviceTypes `json:"devicetypes,omitempty"`
|
||||||
UpdateState uint8 `json:"updatestate,omitempty"`
|
UpdateState uint8 `json:"updatestate,omitempty"`
|
||||||
Notify bool `json:"notify,omitempty"`
|
Notify bool `json:"notify,omitempty"`
|
||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
|
Loading…
Reference in New Issue
Block a user