fix mill
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-11-08 22:55:23 +01:00
parent 083df1749b
commit 204f372be2
+5 -4
View File
@@ -20,7 +20,8 @@ type WifiBridge struct {
ID string
IP string
state *device.State
state *device.State
desiredState device.State
mx sync.Mutex
started bool
@@ -36,6 +37,8 @@ func (w *WifiBridge) SetState(id string, state device.State) bool {
return false
}
w.desiredState = state
return true
}
@@ -93,9 +96,7 @@ func (w *WifiBridge) refresh() error {
})
}
w.state.Temperature = gentools.Ptr(*w.state.Temperature - math.Mod(*w.state.Temperature, 0.5))
if math.Abs(temp-*w.state.Temperature) >= 0.1 {
if w.desiredState.Temperature != nil && math.Abs(temp-*w.desiredState.Temperature) >= 0.1 {
if err := w.writeTemperature(); err != nil {
return err
}