mirror of
https://github.com/pommi/python-itho-wpu.git
synced 2024-11-10 12:12:13 +01:00
feat(itho-wpu): add manufacturer naming
This commit is contained in:
parent
ff19686d74
commit
8109e32bb6
17
itho-wpu.py
17
itho-wpu.py
@ -188,13 +188,18 @@ def process_response(action, response, args):
|
|||||||
|
|
||||||
|
|
||||||
def process_nodeid(response):
|
def process_nodeid(response):
|
||||||
|
hardware_info = {
|
||||||
|
0: {
|
||||||
|
"name": "HCCP",
|
||||||
|
"type": {
|
||||||
|
13: "WPU",
|
||||||
|
15: "Autotemp",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
manufacturergroup = ((int(response[5], 0) << 8) + int(response[6], 0))
|
manufacturergroup = ((int(response[5], 0) << 8) + int(response[6], 0))
|
||||||
manufacturer = int(response[7], 0)
|
manufacturer = hardware_info[int(response[7], 0)]["name"]
|
||||||
hardwaretype = int(response[8], 0)
|
hardwaretype = hardware_info[int(response[7], 0)]["type"][int(response[8], 0)]
|
||||||
if hardwaretype == 0x0d:
|
|
||||||
hardwaretype = "WPU"
|
|
||||||
elif hardwaretype == 0x0f:
|
|
||||||
hardwaretype = "AutoTemp"
|
|
||||||
productversion = int(response[9], 0)
|
productversion = int(response[9], 0)
|
||||||
listversion = int(response[10], 0)
|
listversion = int(response[10], 0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user