1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-20 01:00:07 -07:00

decode_monitor_binary bytestring index fix (by NorDroN)

This commit is contained in:
krocans 2018-09-04 00:24:14 +03:00
parent 5a5e8bf47d
commit 93151962e9

View File

@ -695,11 +695,10 @@ class ModelInfo(object):
decoded = {}
for item in self.data['Monitoring']['protocol']:
key = item['value']
value = 0
for i in range(item['startByte'], item['startByte'] + item['length']):
value = value * 256 + data[i - 1]
decoded[key] = str(value)
value = value * 256 + data[i]
decoded[item['value']] = str(value)
return decoded
def decode_monitor_json(self, data):