From 462a438f894ccafaa830e3e2e578d9f79a741a4c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 2 Dec 2017 01:09:43 +0100 Subject: [PATCH 1/3] Version bump to 0.59.0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index f46058b186c..beb34146e70 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 59 -PATCH_VERSION = '0.dev0' +PATCH_VERSION = '0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) From 58e66c947bd1d9c248f14a31a68ff7becf70a610 Mon Sep 17 00:00:00 2001 From: PhracturedBlue Date: Sat, 2 Dec 2017 13:44:55 -0800 Subject: [PATCH 2/3] Fix issues from review of ecobee weather component (#10903) * Fix issues from review * Don't use STATE_UNKNOWN --- homeassistant/components/weather/ecobee.py | 55 +++++++++++++++------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/weather/ecobee.py b/homeassistant/components/weather/ecobee.py index 8c5354cfdab..379f5c1211b 100644 --- a/homeassistant/components/weather/ecobee.py +++ b/homeassistant/components/weather/ecobee.py @@ -4,11 +4,10 @@ Support for displaying weather info from Ecobee API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/weather.ecobee/ """ -import logging from homeassistant.components import ecobee from homeassistant.components.weather import ( WeatherEntity, ATTR_FORECAST_TEMP, ATTR_FORECAST_TIME) -from homeassistant.const import (STATE_UNKNOWN, TEMP_FAHRENHEIT) +from homeassistant.const import (TEMP_FAHRENHEIT) DEPENDENCIES = ['ecobee'] @@ -52,8 +51,8 @@ class EcobeeWeather(WeatherEntity): try: forecast = self.weather['forecasts'][index] return forecast[param] - except (ValueError, IndexError): - return STATE_UNKNOWN + except (ValueError, IndexError, KeyError): + raise ValueError @property def name(self): @@ -63,12 +62,18 @@ class EcobeeWeather(WeatherEntity): @property def condition(self): """Return the current condition.""" - return self.get_forecast(0, 'condition') + try: + return self.get_forecast(0, 'condition') + except ValueError: + return None @property def temperature(self): """Return the temperature.""" - return float(self.get_forecast(0, 'temperature')) / 10 + try: + return float(self.get_forecast(0, 'temperature')) / 10 + except ValueError: + return None @property def temperature_unit(self): @@ -78,34 +83,51 @@ class EcobeeWeather(WeatherEntity): @property def pressure(self): """Return the pressure.""" - return int(self.get_forecast(0, 'pressure')) + try: + return int(self.get_forecast(0, 'pressure')) + except ValueError: + return None @property def humidity(self): """Return the humidity.""" - return int(self.get_forecast(0, 'relativeHumidity')) + try: + return int(self.get_forecast(0, 'relativeHumidity')) + except ValueError: + return None @property def visibility(self): """Return the visibility.""" - return int(self.get_forecast(0, 'visibility')) + try: + return int(self.get_forecast(0, 'visibility')) + except ValueError: + return None @property def wind_speed(self): """Return the wind speed.""" - return int(self.get_forecast(0, 'windSpeed')) + try: + return int(self.get_forecast(0, 'windSpeed')) + except ValueError: + return None @property def wind_bearing(self): """Return the wind direction.""" - return int(self.get_forecast(0, 'windBearing')) + try: + return int(self.get_forecast(0, 'windBearing')) + except ValueError: + return None @property def attribution(self): """Return the attribution.""" - station = self.weather['weatherStation'] - time = self.weather['timestamp'] - return "Ecobee weather provided by " + station + " at " + time + if self.weather: + station = self.weather.get('weatherStation', "UNKNOWN") + time = self.weather.get('timestamp', "UNKNOWN") + return "Ecobee weather provided by {} at {}".format(station, time) + return None @property def forecast(self): @@ -134,8 +156,8 @@ class EcobeeWeather(WeatherEntity): int(day['relativeHumidity']) forecasts.append(forecast) return forecasts - except (ValueError, IndexError): - return STATE_UNKNOWN + except (ValueError, IndexError, KeyError): + return None def update(self): """Get the latest state of the sensor.""" @@ -143,4 +165,3 @@ class EcobeeWeather(WeatherEntity): data.update() thermostat = data.ecobee.get_thermostat(self._index) self.weather = thermostat.get('weather', None) - logging.error("Weather Update") From 68dc0d4d995b3de2d25748db09de6a9e00e418e1 Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Sun, 3 Dec 2017 00:15:57 +0100 Subject: [PATCH 3/3] Bugfix #10902 (#10904) --- homeassistant/components/zwave/node_entity.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/zwave/node_entity.py b/homeassistant/components/zwave/node_entity.py index 04446cff9a1..de8ca0c1ab9 100644 --- a/homeassistant/components/zwave/node_entity.py +++ b/homeassistant/components/zwave/node_entity.py @@ -137,6 +137,9 @@ class ZWaveNodeEntity(ZWaveBaseEntity): if self.node.can_wake_up(): for value in self.node.get_values(COMMAND_CLASS_WAKE_UP).values(): + if value.index != 0: + continue + self.wakeup_interval = value.data break else: