Add battery attribute to Sensibo (#14735)

* Added battery attribute

* Simplify current_battery
pull/14743/merge
michaeldavie 2018-06-01 13:41:04 -04:00 committed by Fabian Affolter
parent f5d74e07d5
commit 4935043f4a
1 changed files with 7 additions and 1 deletions

View File

@ -154,7 +154,8 @@ class SensiboClimate(ClimateDevice):
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {ATTR_CURRENT_HUMIDITY: self.current_humidity}
return {ATTR_CURRENT_HUMIDITY: self.current_humidity,
'battery': self.current_battery}
@property
def temperature_unit(self):
@ -191,6 +192,11 @@ class SensiboClimate(ClimateDevice):
"""Return the current humidity."""
return self._measurements['humidity']
@property
def current_battery(self):
"""Return the current battery voltage."""
return self._measurements.get('batteryVoltage')
@property
def current_temperature(self):
"""Return the current temperature."""