1
0
mirror of https://github.com/pommi/python-itho-wpu.git synced 2025-06-30 23:45:43 +02:00

feat: add support for reading manual operations

This commit is contained in:
2023-07-21 15:26:12 +02:00
parent 381dd4c6ec
commit 63f06400ef
5 changed files with 120 additions and 19 deletions

View File

@ -19,6 +19,7 @@ actions = {
"getdatalog": [0xA4, 0x01],
"getsetting": [0xA4, 0x10],
"setsetting": [0xA4, 0x10],
"getmanual": [0x40, 0x30],
}
@ -76,6 +77,16 @@ class I2CMaster:
+ [0x00, 0x00, 0x00, 0x00] # step
+ [0x00, identifier, 0x00]
)
elif action == "getmanual":
byte_identifier = list(identifier.to_bytes(2, byteorder="big"))
request = (
[0x80]
+ actions[action]
+ [0x04, 0x04] # read, length
+ [0x01] # bank
+ byte_identifier
+ [0x01] # 1 = manual
)
else:
# 0x80 = source, 0x04 = msg_type, 0x00 = length
request = [0x80] + actions[action] + [0x04, 0x00]