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:
Ville Skyttä 2021-05-20 20:19:20 +03:00 committed by GitHub
parent 0e7409e617
commit 19d25cd901
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 557 additions and 688 deletions

View file

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