I'm trying to check the sum of some data stored in a dictionary of bytes (block variable) and I'm getting this weird behavior.
TypeError: unsupported operand type(s) for +: 'int' and 'bytes'
Here is a snippet.
values = block.values()
if sum(values) == data:
return True
else:
return False
The block looks like this:
{'V': b'26587\r', 'VS': b'31\r', 'I': b'0\r', 'P': b'0\r', 'CE': b'0\r', 'SOC': b'1000\r', 'TTG': b'-1\r', 'Alarm': b'OFF\r', 'Relay': b'OFF\r', 'AR': b'0\r', 'BMV': b'712 Smart\r', 'FW': b'0408\r', 'MON': b'0\r'}