From 2be0d1b0969a823bded0b474f121d72a1d703435 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Thu, 10 Jan 2019 17:24:35 -0800 Subject: [PATCH] Upgrade blinkpy and use calibrated temperature for sensor (#19723) --- homeassistant/components/blink/__init__.py | 2 +- homeassistant/components/sensor/blink.py | 7 +++++-- requirements_all.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/blink/__init__.py b/homeassistant/components/blink/__init__.py index a56885a22a9..ac2a4574b9c 100644 --- a/homeassistant/components/blink/__init__.py +++ b/homeassistant/components/blink/__init__.py @@ -15,7 +15,7 @@ from homeassistant.const import ( CONF_BINARY_SENSORS, CONF_SENSORS, CONF_FILENAME, CONF_MONITORED_CONDITIONS, TEMP_FAHRENHEIT) -REQUIREMENTS = ['blinkpy==0.11.0'] +REQUIREMENTS = ['blinkpy==0.11.1'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/sensor/blink.py b/homeassistant/components/sensor/blink.py index 6d3ca87c4ae..a1a07cb2a73 100644 --- a/homeassistant/components/sensor/blink.py +++ b/homeassistant/components/sensor/blink.py @@ -44,6 +44,9 @@ class BlinkSensor(Entity): self._unit_of_measurement = units self._icon = icon self._unique_id = "{}-{}".format(self._camera.serial, self._type) + self._sensor_key = self._type + if self._type == 'temperature': + self._sensor_key = 'temperature_calibrated' @property def name(self): @@ -74,9 +77,9 @@ class BlinkSensor(Entity): """Retrieve sensor data from the camera.""" self.data.refresh() try: - self._state = self._camera.attributes[self._type] + self._state = self._camera.attributes[self._sensor_key] except KeyError: self._state = None _LOGGER.error( "%s not a valid camera attribute. Did the API change?", - self._type) + self._sensor_key) diff --git a/requirements_all.txt b/requirements_all.txt index 944e4a70751..28bccd62ea9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -196,7 +196,7 @@ bellows==0.7.0 bimmer_connected==0.5.3 # homeassistant.components.blink -blinkpy==0.11.0 +blinkpy==0.11.1 # homeassistant.components.light.blinksticklight blinkstick==1.1.8