Skip to content

Commit

Permalink
sort point names so they always get the same ID for a given model
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed May 23, 2023
1 parent de539d1 commit dd83fb1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions alfalfa_bacnet_bridge/alfalfa_bacnet_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def __init__(self, host, site_id: SiteID) -> None:

def setup_points(self):
inputs = self.client.get_inputs(self.site_id)
inputs.sort()
outputs = self.client.get_outputs(self.site_id)
output_names = list(outputs.keys())
output_names.sort()

index = 0

Expand All @@ -90,10 +93,10 @@ def setup_points(self):
print(f"Creating INPUT point: '{input}'")
index += 1

for output, value in outputs.items():
for output in output_names:
if output in self.points:
continue
self.points[output] = AnalogInputObject(objectName=output, objectIdentifier=("analogInput", index), presentValue=value)
self.points[output] = AnalogInputObject(objectName=output, objectIdentifier=("analogInput", index), presentValue=outputs[output])
print(f"Creating OUTPUT point: '{output}'")
index += 1

Expand Down

0 comments on commit dd83fb1

Please sign in to comment.