Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yozik04/nibe
Browse files Browse the repository at this point in the history
  • Loading branch information
yozik04 committed Dec 10, 2023
2 parents ce45060 + 74c8beb commit 786fb56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nibe/connection/nibegw.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ def _encode(self, obj, context, path):
OPERATIONAL_MODE=0x04,
FUNCTIONS=0x05,
TEMPERATURE=0x06,
SETPOINT_S1=0x09,
SETPOINT_S2=0x11,
SETPOINT_S3=0x13,
SETPOINT_S4=0x15,
)

ADDRESS_TO_ROOM_TEMP_COIL = {
Expand Down Expand Up @@ -696,6 +700,10 @@ def _encode(self, obj, context, path):
allow_cooling=0x04,
),
"OPERATIONAL_MODE": Int8ub,
"SETPOINT_S1": FixedPoint(Int8ub, 0.1, 0.0),
"SETPOINT_S2": FixedPoint(Int8ub, 0.1, 0.0),
"SETPOINT_S3": FixedPoint(Int8ub, 0.1, 0.0),
"SETPOINT_S4": FixedPoint(Int8ub, 0.1, 0.0),
},
default=Select(
Int16ul,
Expand Down
6 changes: 6 additions & 0 deletions tests/connection/test_nibegw_message_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ def test_parse_rmu_write_request(self):
assert data.data.index == "TEMPERATURE"
assert data.data.value == 21.0

hex = bytes([192, 96, 3, 9, 230, 0, 76]).hex()
data = self._parse_hexlified_raw_message(hex)
assert data.cmd == "RMU_WRITE_REQ"
assert data.data.index == "SETPOINT_S1"
assert data.data.value == 23.0


if __name__ == "__main__":
unittest.main()

0 comments on commit 786fb56

Please sign in to comment.