From 3fe1ca97fc0b0fbb41572d10f5f9cce532a6b79f Mon Sep 17 00:00:00 2001 From: TShapinsky Date: Wed, 7 Jun 2023 09:42:39 -0600 Subject: [PATCH] Add ability to cede control of point by writing null to priority array --- alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py b/alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py index 20409f0..e338756 100644 --- a/alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py +++ b/alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py @@ -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: @@ -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)