Skip to content

Commit

Permalink
V003 (#19)
Browse files Browse the repository at this point in the history
* Updated README

* Force faucet battery to return None when not able to determine value. (#15)

* Bump dev version 0.0.2

* Fix faucet battery property (#17)

* Bump dev version 0.0.3
  • Loading branch information
tchellomello authored Oct 9, 2017
1 parent 7056929 commit 6cc0b15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions raincloudy/faucet.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def status(self):
@property
def battery(self):
"""Return faucet battery."""
battery_level = self._lookup_attr('active_faucet_battery_level')
return battery_level if isinstance(battery_level, int) else None
battery = self._lookup_attr('active_faucet_battery_level')
if battery == '' or battery is None:
return None
return battery.strip('%')

def update(self):
"""Callback self._controller.update()."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name='raincloudy',
packages=['raincloudy'],
version='0.0.2',
version='0.0.3',
description='A Python library to communicate with Melnor' +
' RainCloud Smart Garden Watering Irrigation Timer' +
' (https://wwww.melnor.com/)',
Expand Down

0 comments on commit 6cc0b15

Please sign in to comment.