Skip to content

Commit

Permalink
Merge pull request #10 from NREL/deterministic_point_ids
Browse files Browse the repository at this point in the history
Make point IDs deterministic.
  • Loading branch information
TShapinsky authored May 25, 2023
2 parents bdff51d + dd83fb1 commit 8146c85
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 @@ -78,7 +78,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 @@ -91,10 +94,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 8146c85

Please sign in to comment.