Allow input_* and timer component setup without config (#30772)
* Allow input_boolean setup without config. * Allow input_number setup without config. * Allow input_select setup without config. * Allow input_text setup without config. * Allow timer setup without config.
This commit is contained in:
parent
8af946fba5
commit
5fa7d6f22a
10 changed files with 108 additions and 13 deletions
|
@ -333,3 +333,22 @@ async def test_ws_delete(hass, hass_ws_client, storage_setup):
|
|||
state = hass.states.get(input_entity_id)
|
||||
assert state is None
|
||||
assert ent_reg.async_get_entity_id(DOMAIN, DOMAIN, input_id) is None
|
||||
|
||||
|
||||
async def test_setup_no_config(hass, hass_admin_user):
|
||||
"""Test component setup with no config."""
|
||||
count_start = len(hass.states.async_entity_ids())
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
|
||||
with patch(
|
||||
"homeassistant.config.load_yaml_config_file", autospec=True, return_value={}
|
||||
):
|
||||
await hass.services.async_call(
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
blocking=True,
|
||||
context=Context(user_id=hass_admin_user.id),
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert count_start == len(hass.states.async_entity_ids())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue