diff --git a/homeassistant/components/logbook.py b/homeassistant/components/logbook.py index bdc3fa3dce3..053648e3428 100644 --- a/homeassistant/components/logbook.py +++ b/homeassistant/components/logbook.py @@ -50,6 +50,8 @@ CONFIG_SCHEMA = vol.Schema({ GROUP_BY_MINUTES = 15 +CONTINUOUS_DOMAINS = ['proximity', 'sensor'] + ATTR_NAME = 'name' ATTR_MESSAGE = 'message' ATTR_DOMAIN = 'domain' @@ -190,7 +192,8 @@ def humanify(events): if entity_id is None: continue - if entity_id.startswith('sensor.'): + if entity_id.startswith(tuple('{}.'.format( + domain) for domain in CONTINUOUS_DOMAINS)): last_sensor_event[entity_id] = event elif event.event_type == EVENT_HOMEASSISTANT_STOP: @@ -222,12 +225,12 @@ def humanify(events): domain = to_state.domain # Skip all but the last sensor state - if domain == 'sensor' and \ + if domain in CONTINUOUS_DOMAINS and \ event != last_sensor_event[to_state.entity_id]: continue # Don't show continuous sensor value changes in the logbook - if domain == 'sensor' and \ + if domain in CONTINUOUS_DOMAINS and \ to_state.attributes.get('unit_of_measurement'): continue