mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-05 23:15:07 -06:00
fix bug when registering multiple schedules and >=1 are sunset/sunrise
This commit is contained in:
2
app.go
2
app.go
@@ -77,7 +77,7 @@ func (a *App) RegisterSchedules(schedules ...Schedule) {
|
||||
// realStartTime already set for sunset/sunrise
|
||||
if s.isSunrise || s.isSunset {
|
||||
a.schedules.Insert(s, float64(s.realStartTime.Unix()))
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
if s.frequency == 0 {
|
||||
|
||||
@@ -36,16 +36,6 @@ func (ha *HomeAssistant) Toggle(entityId string, serviceData ...map[string]any)
|
||||
}
|
||||
|
||||
ws.WriteMessage(req, ha.conn, ha.ctx)
|
||||
// msg, _ := ws.ReadMessage(ha.conn, ha.ctx)
|
||||
// log.Default().Println(string(msg))
|
||||
// msg, _ = ws.ReadMessage(ha.conn, ha.ctx)
|
||||
// log.Default().Println(string(msg))
|
||||
// msg, _ = ws.ReadMessage(ha.conn, ha.ctx)
|
||||
// log.Default().Println(string(msg))
|
||||
// msg, _ = ws.ReadMessage(ha.conn, ha.ctx)
|
||||
// log.Default().Println(string(msg))
|
||||
// msg, _ = ws.ReadMessage(ha.conn, ha.ctx)
|
||||
// log.Default().Println(string(msg))
|
||||
}
|
||||
|
||||
func (ha *HomeAssistant) TurnOff(entityId string) {
|
||||
|
||||
Reference in New Issue
Block a user