mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Remove unused is_on helper function from Alert (#80190)
This commit is contained in:
parent
ad6c3d1cde
commit
37a5a09910
@ -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] = []
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user