feat: add support for reading manual operations
This commit is contained in:
parent
381dd4c6ec
commit
63f06400ef
5 changed files with 120 additions and 19 deletions
11
itho_i2c.py
11
itho_i2c.py
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue