Remove unused is_on helper function from Alert (#80190)

This commit is contained in:
Franck Nijhof 2022-10-12 20:10:03 +02:00 committed by GitHub
parent ad6c3d1cde
commit 37a5a09910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 15 deletions

View File

@ -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] = []

View File

@ -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)