Skip to content

Commit

Permalink
Added flow_gallons reset to Station Turn On to address bug OpenSprink…
Browse files Browse the repository at this point in the history
…ler#248

If a station did not have a flow meter or open properly, the code was recording the flow amount from the previous station run to the logs. This should reset the flow_gallons counter properly when a station starts.
  • Loading branch information
bb09961 authored Sep 21, 2023
1 parent 0e1985d commit e5ac012
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,8 @@ void check_weather() {
void turn_on_station(byte sid, ulong duration) {
// RAH implementation of flow sensor
flow_start=0;
//Added flow_gallons reset to station turn on.
flow_gallons=0;

if (os.set_station_bit(sid, 1, duration)) {
push_message(NOTIFY_STATION_ON, sid, duration);
Expand Down

0 comments on commit e5ac012

Please sign in to comment.