1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-30 12:14:20 +01:00

Fix dangerous-default-value warnings in greeneye_monitor tests (#119581)

This commit is contained in:
epenet
2024-06-13 16:47:53 +02:00
committed by GitHub
parent 9f322b20d1
commit e34c42c0a9
@@ -19,13 +19,15 @@ def assert_sensor_state(
hass: HomeAssistant,
entity_id: str,
expected_state: str,
attributes: dict[str, Any] = {},
attributes: dict[str, Any] | None = None,
) -> None:
"""Assert that the given entity has the expected state and at least the provided attributes."""
state = hass.states.get(entity_id)
assert state
actual_state = state.state
assert actual_state == expected_state
if not attributes:
return
for key, value in attributes.items():
assert key in state.attributes
assert state.attributes[key] == value