From d17753009a61b70181aa426d3e9f350c0c9fa999 Mon Sep 17 00:00:00 2001 From: R1chardTM Date: Thu, 8 Dec 2016 06:45:43 +0100 Subject: [PATCH 1/5] Fix python-nest version bump (#4799) * Fix python-nest version bump * Change SHA so version in HASS and dependency are the same --- homeassistant/components/nest.py | 4 ++-- requirements_all.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/nest.py b/homeassistant/components/nest.py index 0952129c439..fd5627987a3 100644 --- a/homeassistant/components/nest.py +++ b/homeassistant/components/nest.py @@ -19,8 +19,8 @@ _LOGGER = logging.getLogger(__name__) REQUIREMENTS = [ 'http://github.com/technicalpickles/python-nest' - '/archive/dd628f90772d170b9602f262d5d2e7d61bdd3cf5.zip' # nest-cam branch - '#python-nest==3.0.0'] + '/archive/7a2eb38d391bddeb78079437f001224c370b555a.zip' # nest-cam branch + '#python-nest==3.0.1'] DOMAIN = 'nest' diff --git a/requirements_all.txt b/requirements_all.txt index 387fa216a82..a024bc15168 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -164,7 +164,7 @@ hikvision==0.4 # http://github.com/adafruit/Adafruit_Python_DHT/archive/310c59b0293354d07d94375f1365f7b9b9110c7d.zip#Adafruit_DHT==1.3.0 # homeassistant.components.nest -http://github.com/technicalpickles/python-nest/archive/dd628f90772d170b9602f262d5d2e7d61bdd3cf5.zip#python-nest==3.0.0 +http://github.com/technicalpickles/python-nest/archive/7a2eb38d391bddeb78079437f001224c370b555a.zip#python-nest==3.0.1 # homeassistant.components.light.flux_led https://github.com/Danielhiversen/flux_led/archive/0.9.zip#flux_led==0.9 From b857d5dad09ca05a1139685377cd38e409f58f65 Mon Sep 17 00:00:00 2001 From: Josh Nichols Date: Fri, 9 Dec 2016 14:04:40 -0500 Subject: [PATCH 2/5] Bump python-nest to fix issue with Nest Cam without activity zones (#4820) * Bump python-nest to fix issue with Nest Cam without activity zones * bump to include fix python-nest dependency with hvac_state * regenerate requirements_all.txt --- homeassistant/components/nest.py | 4 ++-- requirements_all.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/nest.py b/homeassistant/components/nest.py index fd5627987a3..cd871c8e039 100644 --- a/homeassistant/components/nest.py +++ b/homeassistant/components/nest.py @@ -19,8 +19,8 @@ _LOGGER = logging.getLogger(__name__) REQUIREMENTS = [ 'http://github.com/technicalpickles/python-nest' - '/archive/7a2eb38d391bddeb78079437f001224c370b555a.zip' # nest-cam branch - '#python-nest==3.0.1'] + '/archive/b8391d2b3cb8682f8b0c2bdff477179983609f39.zip' # nest-cam branch + '#python-nest==3.0.2'] DOMAIN = 'nest' diff --git a/requirements_all.txt b/requirements_all.txt index a024bc15168..93ba123ea10 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -164,7 +164,7 @@ hikvision==0.4 # http://github.com/adafruit/Adafruit_Python_DHT/archive/310c59b0293354d07d94375f1365f7b9b9110c7d.zip#Adafruit_DHT==1.3.0 # homeassistant.components.nest -http://github.com/technicalpickles/python-nest/archive/7a2eb38d391bddeb78079437f001224c370b555a.zip#python-nest==3.0.1 +http://github.com/technicalpickles/python-nest/archive/b8391d2b3cb8682f8b0c2bdff477179983609f39.zip#python-nest==3.0.2 # homeassistant.components.light.flux_led https://github.com/Danielhiversen/flux_led/archive/0.9.zip#flux_led==0.9 From 2402897f478e809740ab5d24311c702afd570dd7 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 11 Dec 2016 17:34:26 -0800 Subject: [PATCH 3/5] Fix Nest doing I/O inside event loop (#4855) --- homeassistant/components/sensor/nest.py | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/homeassistant/components/sensor/nest.py b/homeassistant/components/sensor/nest.py index 53f767ab494..b9dde96a98c 100644 --- a/homeassistant/components/sensor/nest.py +++ b/homeassistant/components/sensor/nest.py @@ -128,13 +128,20 @@ class NestSensor(Entity): # device specific self._location = self.device.where - self._name = self.device.name_long + self._name = "{} {}".format(self.device.name_long, + self.variable.replace("_", " ")) self._state = None + self._unit = None @property def name(self): """Return the name of the nest, if any.""" - return "{} {}".format(self._name, self.variable.replace("_", " ")) + return self._name + + @property + def unit_of_measurement(self): + """Return the unit the value is expressed in.""" + return self._unit class NestBasicSensor(NestSensor): @@ -145,13 +152,10 @@ class NestBasicSensor(NestSensor): """Return the state of the sensor.""" return self._state - @property - def unit_of_measurement(self): - """Return the unit the value is expressed in.""" - return SENSOR_UNITS.get(self.variable, None) - def update(self): """Retrieve latest state.""" + self._unit = SENSOR_UNITS.get(self.variable, None) + if self.variable == 'operation_mode': self._state = getattr(self.device, "mode") else: @@ -161,14 +165,6 @@ class NestBasicSensor(NestSensor): class NestTempSensor(NestSensor): """Representation of a Nest Temperature sensor.""" - @property - def unit_of_measurement(self): - """Return the unit the value is expressed in.""" - if self.device.temperature_scale == 'C': - return TEMP_CELSIUS - else: - return TEMP_FAHRENHEIT - @property def state(self): """Return the state of the sensor.""" @@ -176,6 +172,11 @@ class NestTempSensor(NestSensor): def update(self): """Retrieve latest state.""" + if self.device.temperature_scale == 'C': + self._unit = TEMP_CELSIUS + else: + self._unit = TEMP_FAHRENHEIT + temp = getattr(self.device, self.variable) if temp is None: self._state = None From 1e9d91be0ec6784be83023d6747a34d00068eda0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 11 Dec 2016 17:34:13 -0800 Subject: [PATCH 4/5] Fix Plex from doing I/O inside event loop (#4857) --- homeassistant/components/media_player/plex.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/media_player/plex.py b/homeassistant/components/media_player/plex.py index 76278722291..5aaee6a341e 100644 --- a/homeassistant/components/media_player/plex.py +++ b/homeassistant/components/media_player/plex.py @@ -200,6 +200,7 @@ class PlexClient(MediaPlayerDevice): self.update_devices = update_devices self.update_sessions = update_sessions self.set_device(device) + self._season = None def set_device(self, device): """Set the device property.""" @@ -240,9 +241,15 @@ class PlexClient(MediaPlayerDevice): def update(self): """Get the latest details.""" + from plexapi.video import Show + self.update_devices(no_throttle=True) self.update_sessions(no_throttle=True) + if isinstance(self.session, Show): + self._season = self._convert_na_to_none( + self.session.seasons()[0].index) + # pylint: disable=no-self-use, singleton-comparison def _convert_na_to_none(self, value): """Convert PlexAPI _NA() instances to None.""" @@ -310,9 +317,7 @@ class PlexClient(MediaPlayerDevice): @property def media_season(self): """Season of curent playing media (TV Show only).""" - from plexapi.video import Show - if isinstance(self.session, Show): - return self._convert_na_to_none(self.session.seasons()[0].index) + return self._season @property def media_series_title(self): From 96d8fbe5135da7f663a15b6f0df184b6a677a574 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 11 Dec 2016 22:26:48 -0800 Subject: [PATCH 5/5] Version bump to 0.34.5 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 92107bf43a0..bfca70a8092 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 34 -PATCH_VERSION = '4' +PATCH_VERSION = '5' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2)