Skip to content

Commit

Permalink
Adds property model
Browse files Browse the repository at this point in the history
  • Loading branch information
lellky committed Jan 14, 2024
1 parent a749d1d commit 3a726c9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async def main():
# check device name and s/n
print(f"Device Name: {device.device_name}")
print(f"Serial Number: {device.serial_number}")
print(f"Device Model: {device.model}")
print(f"Outside air temp.: {device.outside_air_temperature} °C")
print(f"Supply air temp.: {device.supply_air_temperature} °C")
print(f"Extract air temp.: {device.extract_air_temperature} °C")
Expand Down
10 changes: 10 additions & 0 deletions flexit_bacnet/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def serial_number(self) -> str:

return serial_number

@property
def model(self) -> str:
"""Return device's model, e.g.: Air handling unit Nordic S2 REL."""
model = NORDIC_MODELS.get(int(self.serial_number[0:6]))

if not isinstance(model, str):
return ''

return model

@property
def outside_air_temperature(self) -> float:
"""Outside air temperature in degrees Celsius, e.g. 14.3."""
Expand Down
19 changes: 19 additions & 0 deletions flexit_bacnet/nordic.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,22 @@
DEVICE_PROPERTIES = [
item for _, item in globals().items() if isinstance(item, DeviceProperty)
]

# The first six digits in the Nordic serial number corresponds to the Nordic model.
NORDIC_MODELS = {
800111: "Air handling unit Nordic S2 REL",
800121: "Air handling unit Nordic S3 REL",
800110: "Air handling unit Nordic S2 RER",
800120: "Air handling unit Nordic S3 RER",
800221: "Air handling unit Nordic CL4 REL",
800220: "Air handling unit Nordic CL4 RER",
800130: "Air handling unit Nordic S4 RER",
800131: "Air handling unit Nordic S4 REL",
800210: "Air handling unit Nordic CL2 RER",
800211: "Air handling unit Nordic CL2 REL",
800200: "Air handling unit Nordic CL3 RER",
800201: "Air handling unit Nordic CL3 REL",
800300: "Air handling unit Nordic KS3 RER",
800301: "Air handling unit Nordic KS3 REL",
}

0 comments on commit 3a726c9

Please sign in to comment.