diff --git a/homeassistant/components/hue/hue_event.py b/homeassistant/components/hue/hue_event.py index a588f68ea4e..d3d81a6a7af 100644 --- a/homeassistant/components/hue/hue_event.py +++ b/homeassistant/components/hue/hue_event.py @@ -31,8 +31,8 @@ class HueEvent(GenericHueDevice): self.device_registry_id = None self.event_id = slugify(self.sensor.name) - # Use the 'lastupdated' string to detect new remote presses - self._last_updated = self.sensor.lastupdated + # Use the aiohue sensor 'state' dict to detect new remote presses + self._last_state = dict(self.sensor.state) # Register callback in coordinator and add job to remove it on bridge reset. self.bridge.reset_jobs.append( @@ -45,7 +45,7 @@ class HueEvent(GenericHueDevice): @callback def async_update_callback(self): """Fire the event if reason is that state is updated.""" - if self.sensor.lastupdated == self._last_updated: + if self.sensor.state == self._last_state: return # Extract the press code as state @@ -54,7 +54,7 @@ class HueEvent(GenericHueDevice): else: state = self.sensor.buttonevent - self._last_updated = self.sensor.lastupdated + self._last_state = dict(self.sensor.state) # Fire event data = {