Skip to content

Commit

Permalink
Fix node-red station switch bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-in-CA committed Jul 27, 2024
1 parent 63d4a9e commit 3d974be
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions plugins/node_red.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,12 @@ def station_on_off(data):
except ValueError as e:
return e
bid = sid // 8

if (
not pre # preempt is not set
and gv.pon # a program is running
and (gv.pd[gv.pon - 1]["station_mask"][bid])
& 1 << sid # station is in the program
if (not pre # preempt is not set
and gv.bsy # a program is running
and gv.rs[sid][2] # station has a duration in running program
):
continue # Skip if station is controlled by a running program
): continue # Skip if station is running
elif pre:
stop_stations() # preempt any running program.

if state: # set == 1 in Node-red - applies to all stations in data
gv.rs[sid] = [gv.now, float("inf"), 0, 100]
Expand Down

0 comments on commit 3d974be

Please sign in to comment.