Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
Fix battery percent
Browse files Browse the repository at this point in the history
  • Loading branch information
doudz committed Jun 27, 2018
1 parent 264f11a commit 4b3a051
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .const import *
from pydispatch import dispatcher

__version__ = '0.16.2'
__version__ = '0.16.3'

__all__ = ['ZiGate', 'ZiGateWiFi',
'dispatcher']
2 changes: 2 additions & 0 deletions zigate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b3a051

Please sign in to comment.