Change config entry state to an enum (#49654)
* Change config entry state to an enum * Allow but deprecate EntryState str equality comparison * Test fixes * Rename to ConfigEntryState * Remove str comparability backcompat * Update new occurrences of strs cropped up during review
This commit is contained in:
parent
0e7409e617
commit
19d25cd901
101 changed files with 557 additions and 688 deletions
|
@ -11,7 +11,7 @@ from homeassistant.components.abode import (
|
|||
SERVICE_TRIGGER_AUTOMATION,
|
||||
)
|
||||
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN
|
||||
from homeassistant.config_entries import ENTRY_STATE_SETUP_RETRY
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import CONF_USERNAME, HTTP_BAD_REQUEST
|
||||
|
||||
from .common import setup_platform
|
||||
|
@ -79,7 +79,7 @@ async def test_invalid_credentials(hass):
|
|||
|
||||
|
||||
async def test_raise_config_entry_not_ready_when_offline(hass):
|
||||
"""Config entry state is ENTRY_STATE_SETUP_RETRY when abode is offline."""
|
||||
"""Config entry state is SETUP_RETRY when abode is offline."""
|
||||
with patch(
|
||||
"homeassistant.components.abode.Abode",
|
||||
side_effect=AbodeException("any"),
|
||||
|
@ -87,6 +87,6 @@ async def test_raise_config_entry_not_ready_when_offline(hass):
|
|||
config_entry = await setup_platform(hass, ALARM_DOMAIN)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert config_entry.state == ENTRY_STATE_SETUP_RETRY
|
||||
assert config_entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
assert hass.config_entries.flow.async_progress() == []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue