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.
|
// Run starts the FNN control loop.
|
||||||
func (c *Fnn) Run() {
|
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 {
|
if err := c.runCurtail(); err != nil {
|
||||||
c.log.ERROR.Println(err)
|
c.log.ERROR.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,8 @@ func (c *Relay) SetUpdated(f func()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Relay) Run() {
|
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 {
|
if err := c.run(); err != nil {
|
||||||
c.log.ERROR.Println(err)
|
c.log.ERROR.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,4 @@ hems:
|
||||||
maxPower: 4200
|
maxPower: 4200
|
||||||
limit:
|
limit:
|
||||||
source: const
|
source: const
|
||||||
value: true
|
value: false # inactive: avoids recording a grid session so the locked modal shows no history
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue