mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 03:15:14 -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
|
// realStartTime already set for sunset/sunrise
|
||||||
if s.isSunrise || s.isSunset {
|
if s.isSunrise || s.isSunset {
|
||||||
a.schedules.Insert(s, float64(s.realStartTime.Unix()))
|
a.schedules.Insert(s, float64(s.realStartTime.Unix()))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.frequency == 0 {
|
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)
|
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) {
|
func (ha *HomeAssistant) TurnOff(entityId string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user