mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
History: Ignore insignificant domains
This commit is contained in:
@@ -148,7 +148,7 @@ class TestComponentHistory(unittest.TestCase):
|
||||
"""test that only significant states are returned with
|
||||
get_significant_states.
|
||||
|
||||
We inject a bunch of state updates from media player and
|
||||
We inject a bunch of state updates from media player, zone and
|
||||
thermostat. We should get back every thermostat change that
|
||||
includes an attribute change, but only the state updates for
|
||||
media player (attribute changes are not significant and not returned).
|
||||
@@ -157,6 +157,7 @@ class TestComponentHistory(unittest.TestCase):
|
||||
self.init_recorder()
|
||||
mp = 'media_player.test'
|
||||
therm = 'thermostat.test'
|
||||
zone = 'zone.home'
|
||||
|
||||
def set_state(entity_id, state, **kwargs):
|
||||
self.hass.states.set(entity_id, state, **kwargs)
|
||||
@@ -186,6 +187,8 @@ class TestComponentHistory(unittest.TestCase):
|
||||
# this state will be skipped only different in time
|
||||
set_state(mp, 'YouTube',
|
||||
attributes={'media_title': str(sentinel.mt3)})
|
||||
# this state will be skipped because domain blacklisted
|
||||
set_state(zone, 'zoning')
|
||||
states[therm].append(
|
||||
set_state(therm, 21, attributes={'current_temperature': 19.8}))
|
||||
|
||||
@@ -199,4 +202,4 @@ class TestComponentHistory(unittest.TestCase):
|
||||
set_state(therm, 21, attributes={'current_temperature': 20}))
|
||||
|
||||
hist = history.get_significant_states(zero, four)
|
||||
self.assertEqual(states, hist)
|
||||
assert states == hist
|
||||
|
||||
Reference in New Issue
Block a user