HEMS: run FNN and relay control loops immediately on start (#31392)
This commit is contained in:
parent
e910ee2779
commit
0299650c31
3 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue