Skip to content

Commit

Permalink
Makes BacNet properties configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
bmario committed Nov 7, 2024
1 parent 1b20caa commit f9b143a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions metricq_source_bacpypes/config_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class Device(BaseModel, **_model_config):
class Source(BaseModel, extra="ignore", frozen=True):
bacnetAddress: str
"""Address of the BacNet client used as source"""
bacnetIdentifier: int
"""Identifier for the BacNet client used as source"""
bacnetName: str
"""Name of the BacNet client used as source"""
interval: PositiveFloat | PositiveInt | str | None = None
"""
Default query interval in seconds.
Expand Down
4 changes: 2 additions & 2 deletions metricq_source_bacpypes/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ async def _on_config(
self.bacnet = None

this_device = DeviceObject(
objectName="MetricQBacpypesSource",
objectIdentifier=7,
objectName=config.bacnetName,
objectIdentifier=config.bacnetIdentifier,
vendorIdentifier=15,
maxApduLengthAccepted=1476, # was like that in ye olden scriptures
)
Expand Down

0 comments on commit f9b143a

Please sign in to comment.