diff --git a/custom_components/irm_kmi/__init__.py b/custom_components/irm_kmi/__init__.py index ff9fac9..e3bb875 100644 --- a/custom_components/irm_kmi/__init__.py +++ b/custom_components/irm_kmi/__init__.py @@ -7,7 +7,8 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryError -from .const import DOMAIN, PLATFORMS, CONF_DARK_MODE, CONF_STYLE_STD, CONF_STYLE +from .const import (CONF_DARK_MODE, CONF_STYLE, CONF_STYLE_STD, DOMAIN, + PLATFORMS) from .coordinator import IrmKmiCoordinator from .weather import IrmKmiWeather @@ -16,10 +17,7 @@ _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up this integration using UI.""" - _LOGGER.debug(f"Setting up entry v{entry.version}") - hass.data.setdefault(DOMAIN, {}) - hass.data[DOMAIN][entry.entry_id] = coordinator = IrmKmiCoordinator(hass, entry) try: @@ -58,7 +56,6 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry): new = {**config_entry.data} if config_entry.version == 1: - new = new | {CONF_STYLE: CONF_STYLE_STD, CONF_DARK_MODE: True} config_entry.version = 2 diff --git a/custom_components/irm_kmi/config_flow.py b/custom_components/irm_kmi/config_flow.py index 014f007..60db263 100644 --- a/custom_components/irm_kmi/config_flow.py +++ b/custom_components/irm_kmi/config_flow.py @@ -23,7 +23,6 @@ class IrmKmiConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input: dict | None = None) -> FlowResult: """Define the user step of the configuration flow.""" - print(f"IN CONFIG FLOW HERE with {user_input}") if user_input is not None: _LOGGER.debug(f"Provided config user is: {user_input}") diff --git a/custom_components/irm_kmi/const.py b/custom_components/irm_kmi/const.py index 1d4a4d8..1bca189 100644 --- a/custom_components/irm_kmi/const.py +++ b/custom_components/irm_kmi/const.py @@ -22,7 +22,6 @@ OUT_OF_BENELUX: Final = ["außerhalb der Benelux (Brussels)", "Buiten de Benelux (Brussel)"] LANGS: Final = ['en', 'fr', 'nl', 'de'] - CONF_STYLE_STD: Final = 'standard_style' CONF_STYLE_CONTRAST: Final = 'contrast_style' CONF_STYLE_YELLOW_RED: Final = 'yellow_red_style' diff --git a/custom_components/irm_kmi/coordinator.py b/custom_components/irm_kmi/coordinator.py index f19a03e..61e1186 100644 --- a/custom_components/irm_kmi/coordinator.py +++ b/custom_components/irm_kmi/coordinator.py @@ -135,7 +135,8 @@ class IrmKmiCoordinator(DataUpdateCoordinator): for frame in animation_data: if frame.get('uri', None) is not None: - coroutines.append(self._api_client.get_image(frame.get('uri'), params={'rs': STYLE_TO_PARAM_MAP[style]})) + coroutines.append( + self._api_client.get_image(frame.get('uri'), params={'rs': STYLE_TO_PARAM_MAP[style]})) async with async_timeout.timeout(20): images_from_api = await asyncio.gather(*coroutines) diff --git a/custom_components/irm_kmi/translations/fr.json b/custom_components/irm_kmi/translations/fr.json index 876a6a6..7c6706d 100644 --- a/custom_components/irm_kmi/translations/fr.json +++ b/custom_components/irm_kmi/translations/fr.json @@ -4,7 +4,7 @@ "step": { "user": { "title": "Choisissez une zone", - "data" : { + "data": { "zone": "Zone" } } diff --git a/tests/conftest.py b/tests/conftest.py index fce1209..73cb3f8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,6 +30,7 @@ async def patched(url: str, params: dict | None = None) -> bytes: with open(file_name, "rb") as file: return file.read() + @pytest.fixture(autouse=True) def auto_enable_custom_integrations(enable_custom_integrations): yield