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:
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]
|
||||
|
Reference in New Issue
Block a user