From 3a80e6b5045abfa71c506f580917588c47808182 Mon Sep 17 00:00:00 2001 From: Mark Coombes <30442019+marthoc@users.noreply.github.com> Date: Fri, 17 Nov 2017 20:01:14 -0500 Subject: [PATCH] Added underscores to last updated attributes Though light_level had an underscore, last updated did not, so was causing a problem when making a template sensor. Added underscores to each instance of last updated to make it last_updated. --- custom_components/sensor/hue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/sensor/hue.py b/custom_components/sensor/hue.py index 2b50fb4..2f3e4e9 100644 --- a/custom_components/sensor/hue.py +++ b/custom_components/sensor/hue.py @@ -96,7 +96,7 @@ def update(self): self._hue_id]['light_level'] self._attributes['battery'] = self._data.data[ self._hue_id]['battery'] - self._attributes['last updated'] = self._data.data[ + self._attributes['last_updated'] = self._data.data[ self._hue_id]['last_updated'] self._attributes['lux'] = self._data.data[ self._hue_id]['lux'] @@ -108,13 +108,13 @@ def update(self): self._hue_id]['temperature'] elif self._model == 'RWL': self._icon = 'mdi:remote' - self._attributes['last updated'] = self._data.data[ + self._attributes['last_updated'] = self._data.data[ self._hue_id]['last_updated'] self._attributes['battery'] = self._data.data[ self._hue_id]['battery'] elif self._model == 'ZGP': self._icon = 'mdi:remote' - self._attributes['last updated'] = self._data.data[ + self._attributes['last_updated'] = self._data.data[ self._hue_id]['last_updated'] elif self._model == 'Geofence': self._icon = 'mdi:cellphone'