1
0
mirror of https://github.com/pommi/python-itho-wpu.git synced 2024-12-21 18:43:27 +01:00

feat(itho-wpu): add manufacturer naming

This commit is contained in:
Pim van den Berg 2020-11-21 15:08:10 +01:00
parent 273a22a4c0
commit d40b0d94ff

View File

@ -188,13 +188,18 @@ def process_response(action, response, args):
def process_nodeid(response):
hardware_info = {
0: {
"name": "HCCP",
"type": {
13: "WPU",
15: "Autotemp",
}
}
}
manufacturergroup = ((int(response[5], 0) << 8) + int(response[6], 0))
manufacturer = int(response[7], 0)
hardwaretype = int(response[8], 0)
if hardwaretype == 0x0d:
hardwaretype = "WPU"
elif hardwaretype == 0x0f:
hardwaretype = "AutoTemp"
manufacturer = hardware_info[int(response[7], 0)]["name"]
hardwaretype = hardware_info[int(response[7], 0)]["type"][int(response[8], 0)]
productversion = int(response[9], 0)
listversion = int(response[10], 0)