Upgrade blinkpy and use calibrated temperature for sensor (#19723)

This commit is contained in:
Kevin Fronczak 2019-01-10 17:24:35 -08:00 committed by Paulus Schoutsen
parent 47f64b472d
commit 2be0d1b096
3 changed files with 7 additions and 4 deletions

View File

@ -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__)

View File

@ -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)

View File

@ -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