diff --git a/tests/components/humidifier/test_recorder.py b/tests/components/humidifier/test_recorder.py index 084effb1af8..733f505d0ab 100644 --- a/tests/components/humidifier/test_recorder.py +++ b/tests/components/humidifier/test_recorder.py @@ -36,12 +36,13 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant) get_significant_states, hass, now, None, hass.states.async_entity_ids() ) assert len(states) >= 1 - for entity_states in states.values(): - for state in filter( - lambda state: split_entity_id(state.entity_id)[0] == humidifier.DOMAIN, - entity_states, - ): - assert ATTR_MIN_HUMIDITY not in state.attributes - assert ATTR_MAX_HUMIDITY not in state.attributes - assert ATTR_AVAILABLE_MODES not in state.attributes - assert ATTR_FRIENDLY_NAME in state.attributes + for state in ( + state + for entity_states in states.values() + for state in entity_states + if split_entity_id(state.entity_id)[0] == humidifier.DOMAIN + ): + assert ATTR_MIN_HUMIDITY not in state.attributes + assert ATTR_MAX_HUMIDITY not in state.attributes + assert ATTR_AVAILABLE_MODES not in state.attributes + assert ATTR_FRIENDLY_NAME in state.attributes diff --git a/tests/components/siren/test_recorder.py b/tests/components/siren/test_recorder.py index 37161e92ff6..5fb16f73175 100644 --- a/tests/components/siren/test_recorder.py +++ b/tests/components/siren/test_recorder.py @@ -32,10 +32,11 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant) get_significant_states, hass, now, None, hass.states.async_entity_ids() ) assert len(states) >= 1 - for entity_states in states.values(): - for state in filter( - lambda state: split_entity_id(state.entity_id)[0] == siren.DOMAIN, - entity_states, - ): - assert ATTR_AVAILABLE_TONES not in state.attributes - assert ATTR_FRIENDLY_NAME in state.attributes + for state in ( + state + for entity_states in states.values() + for state in entity_states + if split_entity_id(state.entity_id)[0] == siren.DOMAIN + ): + assert ATTR_AVAILABLE_TONES not in state.attributes + assert ATTR_FRIENDLY_NAME in state.attributes diff --git a/tests/components/vacuum/test_recorder.py b/tests/components/vacuum/test_recorder.py index f1a531fe3d0..c01c47acae0 100644 --- a/tests/components/vacuum/test_recorder.py +++ b/tests/components/vacuum/test_recorder.py @@ -32,10 +32,11 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant) get_significant_states, hass, now, None, hass.states.async_entity_ids() ) assert len(states) >= 1 - for entity_states in states.values(): - for state in filter( - lambda state: split_entity_id(state.entity_id)[0] == vacuum.DOMAIN, - entity_states, - ): - assert ATTR_FAN_SPEED_LIST not in state.attributes - assert ATTR_FRIENDLY_NAME in state.attributes + for state in ( + state + for entity_states in states.values() + for state in entity_states + if split_entity_id(state.entity_id)[0] == vacuum.DOMAIN + ): + assert ATTR_FAN_SPEED_LIST not in state.attributes + assert ATTR_FRIENDLY_NAME in state.attributes diff --git a/tests/components/water_heater/test_recorder.py b/tests/components/water_heater/test_recorder.py index 3455090718b..4b004ce8d5d 100644 --- a/tests/components/water_heater/test_recorder.py +++ b/tests/components/water_heater/test_recorder.py @@ -36,12 +36,13 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant) get_significant_states, hass, now, None, hass.states.async_entity_ids() ) assert len(states) >= 1 - for entity_states in states.values(): - for state in filter( - lambda state: split_entity_id(state.entity_id)[0] == water_heater.DOMAIN, - entity_states, - ): - assert ATTR_OPERATION_LIST not in state.attributes - assert ATTR_MIN_TEMP not in state.attributes - assert ATTR_MAX_TEMP not in state.attributes - assert ATTR_FRIENDLY_NAME in state.attributes + for state in ( + state + for entity_states in states.values() + for state in entity_states + if split_entity_id(state.entity_id)[0] == water_heater.DOMAIN + ): + assert ATTR_OPERATION_LIST not in state.attributes + assert ATTR_MIN_TEMP not in state.attributes + assert ATTR_MAX_TEMP not in state.attributes + assert ATTR_FRIENDLY_NAME in state.attributes