From 37a5a09910af223fd93e1f8d88bb653fb261b6fe Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Oct 2022 20:10:03 +0200 Subject: [PATCH] Remove unused is_on helper function from Alert (#80190) --- homeassistant/components/alert/__init__.py | 5 ----- tests/components/alert/test_init.py | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/homeassistant/components/alert/__init__.py b/homeassistant/components/alert/__init__.py index 1c9a98d5b34..737c17d6cef 100644 --- a/homeassistant/components/alert/__init__.py +++ b/homeassistant/components/alert/__init__.py @@ -80,11 +80,6 @@ CONFIG_SCHEMA = vol.Schema( ALERT_SERVICE_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_ids}) -def is_on(hass: HomeAssistant, entity_id: str) -> bool: - """Return if the alert is firing and not acknowledged.""" - return hass.states.is_state(entity_id, STATE_ON) - - async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Alert component.""" entities: list[Alert] = [] diff --git a/tests/components/alert/test_init.py b/tests/components/alert/test_init.py index 8f6d3e41343..e4f90a1a989 100644 --- a/tests/components/alert/test_init.py +++ b/tests/components/alert/test_init.py @@ -116,16 +116,6 @@ def mock_notifier(hass): return events -async def test_is_on(hass): - """Test is_on method.""" - hass.states.async_set(ENTITY_ID, STATE_ON) - await hass.async_block_till_done() - assert alert.is_on(hass, ENTITY_ID) - hass.states.async_set(ENTITY_ID, STATE_OFF) - await hass.async_block_till_done() - assert not alert.is_on(hass, ENTITY_ID) - - async def test_setup(hass): """Test setup method.""" assert await async_setup_component(hass, DOMAIN, TEST_CONFIG)