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

@ -4,7 +4,7 @@ from unittest.mock import patch
import pytest
from homeassistant.config_entries import ENTRY_STATE_LOADED
from homeassistant.config_entries import ConfigEntryState
from .common import MQTTMessage
@ -275,6 +275,6 @@ def mock_get_addon_discovery_info():
@pytest.fixture(name="mqtt")
async def mock_mqtt_fixture(hass):
"""Mock the MQTT integration."""
mqtt_entry = MockConfigEntry(domain="mqtt", state=ENTRY_STATE_LOADED)
mqtt_entry = MockConfigEntry(domain="mqtt", state=ConfigEntryState.LOADED)
mqtt_entry.add_to_hass(hass)
return mqtt_entry