1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00
This commit is contained in:
Paulus Schoutsen
2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View File

@@ -28,8 +28,7 @@ class BlinkSensor(Entity):
def __init__(self, data, camera, sensor_type):
"""Initialize sensors from Blink camera."""
name, units, icon = SENSORS[sensor_type]
self._name = "{} {} {}".format(
BLINK_DATA, camera, name)
self._name = "{} {} {}".format(BLINK_DATA, camera, name)
self._camera_name = name
self._type = sensor_type
self.data = data
@@ -39,8 +38,8 @@ class BlinkSensor(Entity):
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'
if self._type == "temperature":
self._sensor_key = "temperature_calibrated"
@property
def name(self):
@@ -75,5 +74,5 @@ class BlinkSensor(Entity):
except KeyError:
self._state = None
_LOGGER.error(
"%s not a valid camera attribute. Did the API change?",
self._sensor_key)
"%s not a valid camera attribute. Did the API change?", self._sensor_key
)