diff --git a/zigate/__init__.py b/zigate/__init__.py index ca69fb63..42e0a6f9 100644 --- a/zigate/__init__.py +++ b/zigate/__init__.py @@ -4,7 +4,7 @@ from .const import * from pydispatch import dispatcher -__version__ = '0.16.2' +__version__ = '0.16.3' __all__ = ['ZiGate', 'ZiGateWiFi', 'dispatcher'] diff --git a/zigate/core.py b/zigate/core.py index 41ea5830..d6a256b7 100644 --- a/zigate/core.py +++ b/zigate/core.py @@ -1378,6 +1378,8 @@ def battery_percent(self): percent = 100 if self.info.get('power_type') == 0: power_source = self.get_property_value('power_source') + if power_source is None: + power_source = 3 battery = self.get_property_value('battery') if power_source == 3: # battery power_source = 3.2