Skip to content

Commit

Permalink
Add ability to cede control of point by writing null to priority array
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Jun 7, 2023
1 parent 8146c85 commit 3fe1ca9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def setup_points(self):
else:
self.points[input] = AnalogValueCmdObject(objectName=input, objectIdentifier=("analogValue", index))
print(f"Creating INPUT point: '{input}'")
self.points[input]._had_value = False
index += 1

for output in output_names:
Expand Down Expand Up @@ -127,6 +128,10 @@ def main_loop():
current_value, value_type = object._highest_priority_value()
if value_type is not None:
set_inputs[point] = current_value
object._had_value = True
elif object._had_value:
set_inputs[point] = None
object._had_value = False
if len(set_inputs) > 0:
self.client.set_inputs(self.site_id, set_inputs)

Expand Down

0 comments on commit 3fe1ca9

Please sign in to comment.