HEMS: run FNN and relay control loops immediately on start (#31392)

This commit is contained in:
andig 2026-07-01 21:50:08 +02:00 • committed by GitHub
parent e910ee2779
commit 0299650c31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -120,7 +120,8 @@ func (c *Fnn) SetUpdated(f func()) {
// Run starts the FNN control loop.
func (c *Fnn) Run() {
for range time.Tick(c.interval) {
// run immediately, then on every tick
for tick := time.Tick(c.interval); ; <-tick {
if err := c.runCurtail(); err != nil {
c.log.ERROR.Println(err)
}

View file

@ -88,7 +88,8 @@ func (c *Relay) SetUpdated(f func()) {
}
func (c *Relay) Run() {
for range time.Tick(c.interval) {
// run immediately, then on every tick
for tick := time.Tick(c.interval); ; <-tick {
if err := c.run(); err != nil {
c.log.ERROR.Println(err)
}