From 4935043f4a17fd855f2f3e29e0b963700b191273 Mon Sep 17 00:00:00 2001 From: michaeldavie Date: Fri, 1 Jun 2018 13:41:04 -0400 Subject: [PATCH] Add battery attribute to Sensibo (#14735) * Added battery attribute * Simplify current_battery --- homeassistant/components/climate/sensibo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/climate/sensibo.py b/homeassistant/components/climate/sensibo.py index 94d9612755c..b3fff0dd796 100644 --- a/homeassistant/components/climate/sensibo.py +++ b/homeassistant/components/climate/sensibo.py @@ -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."""