Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyblnet/blnet_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
TYPE_DIGITAL = 0x1000
TYPE_TEMP = 0x2000
TYPE_VOLUME = 0x3000
TYPE_RADIATION = 0x4000
# V110 TTTT TTTT TTTT in TA's interface spec, in W/m²
TYPE_RADIATION = 0x6000
TYPE_RAS = 0x7000
RAS_POSITIVE_MASK = 0x01FF
# Temperature input without sensor (or with a broken wire): all value bits set, 409.5 °C
Expand Down
9 changes: 5 additions & 4 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ def test_parser_disconnected_temperature_sensor_is_none(self):
assert parsed_values['analog'][2] == 409.4

def test_parser_input_types(self):
# temperature, volume flow, radiation, digital, unused, room sensor, undocumented type 101
inputs = [0x2000, 0x3000, 0x4000, 0x1000, 0x0000, 0x7000, 0x5000] + [0x2000] * 9
# temperature, volume flow, radiation (110), digital, unused, room sensor,
# undocumented types 101 and 100
inputs = [0x2000, 0x3000, 0x6000, 0x1000, 0x0000, 0x7000, 0x5000, 0x4000] + [0x2000] * 8
data = struct.pack('<16H', *inputs) + bytes(55 - 32)
parsed_values = BLNETParser(data).to_dict()

expected_types = {1: 'temperature', 2: 'volume_flow', 3: 'radiation', 4: 'digital', 5: None, 6: 'temperature', 7: None}
expected_types.update({channel: 'temperature' for channel in range(8, 17)})
expected_types = {1: 'temperature', 2: 'volume_flow', 3: 'radiation', 4: 'digital', 5: None, 6: 'temperature', 7: None, 8: None}
expected_types.update({channel: 'temperature' for channel in range(9, 17)})
assert parsed_values['analog_types'] == expected_types

def test_parser_heat_meter_1_active(self):
Expand Down
Loading