forked from sqozz/sem6000
Merge branch 'fix/zerodivision' of sqozz/sem6000 into master
This commit is contained in:
commit
80e6bbaaed
|
@ -208,7 +208,10 @@ class SEMSocket():
|
||||||
self.__btle_device.total_power = total_power
|
self.__btle_device.total_power = total_power
|
||||||
|
|
||||||
# calculated values
|
# calculated values
|
||||||
|
try:
|
||||||
self.__btle_device.power_factor = power / (voltage * current)
|
self.__btle_device.power_factor = power / (voltage * current)
|
||||||
|
except ZeroDivisionError:
|
||||||
|
self.__btle_device.power_factor = None
|
||||||
elif message_type == 0x17:
|
elif message_type == 0x17:
|
||||||
if data[5] == 0x00 or data[5] == 0x01:
|
if data[5] == 0x00 or data[5] == 0x01:
|
||||||
if data[4]:
|
if data[4]:
|
||||||
|
|
Loading…
Reference in a new issue