Skip to content

Commit

Permalink
Adds battery_percent which had been introduced with pyatmo 1.4 and re…
Browse files Browse the repository at this point in the history
…solves unknown var warning. (home-assistant#19309)
  • Loading branch information
jensihnow authored and dshokouhi committed Dec 25, 2018
1 parent 1683f8d commit 5e0a76e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/sensor/netatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'sum_rain_24': ['sum_rain_24', 'mm', 'mdi:weather-rainy', None],
'battery_vp': ['Battery', '', 'mdi:battery', None],
'battery_lvl': ['Battery_lvl', '', 'mdi:battery', None],
'battery_percent': ['battery_percent', '%', 'mdi:battery', None],
'min_temp': ['Min Temp.', TEMP_CELSIUS, 'mdi:thermometer', None],
'max_temp': ['Max Temp.', TEMP_CELSIUS, 'mdi:thermometer', None],
'windangle': ['Angle', '', 'mdi:compass', None],
Expand Down Expand Up @@ -179,6 +180,8 @@ def update(self):
self._state = data['CO2']
elif self.type == 'pressure':
self._state = round(data['Pressure'], 1)
elif self.type == 'battery_percent':
self._state = data['battery_percent']
elif self.type == 'battery_lvl':
self._state = data['battery_vp']
elif (self.type == 'battery_vp' and
Expand Down

0 comments on commit 5e0a76e

Please sign in to comment.