fix bug when registering multiple schedules and >=1 are sunset/sunrise

This commit is contained in:
Sam Lewis
2022-11-04 22:47:42 -04:00
parent 2575525528
commit 648eb62cfa
2 changed files with 1 additions and 11 deletions

2
app.go
View File

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

View File

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