From 5f782087d7a9660773a36372963fdd6bf0856f80 Mon Sep 17 00:00:00 2001 From: Rob Coleman Date: Wed, 30 Oct 2024 11:58:44 -0700 Subject: [PATCH 1/2] Fix import of Config for HA 2024.11.0b0 The Config class moved to homeassistant.core_config in 2024.11.0b0. --- custom_components/pyscript/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/pyscript/__init__.py b/custom_components/pyscript/__init__.py index 3a96241..6b177aa 100644 --- a/custom_components/pyscript/__init__.py +++ b/custom_components/pyscript/__init__.py @@ -21,7 +21,8 @@ EVENT_STATE_CHANGED, SERVICE_RELOAD, ) -from homeassistant.core import Config, Event as HAEvent, HomeAssistant, ServiceCall +from homeassistant.core import Event as HAEvent, HomeAssistant, ServiceCall +from homeassistant.core_config import Config from homeassistant.exceptions import HomeAssistantError import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import DATA_RESTORE_STATE From 9931d1e54dc4717d42a9c9b66d9655f2ed5bc8a1 Mon Sep 17 00:00:00 2001 From: Rob Coleman Date: Wed, 30 Oct 2024 13:36:01 -0700 Subject: [PATCH 2/2] Use proper type for config parameter --- custom_components/pyscript/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/pyscript/__init__.py b/custom_components/pyscript/__init__.py index 6b177aa..c0f0137 100644 --- a/custom_components/pyscript/__init__.py +++ b/custom_components/pyscript/__init__.py @@ -22,7 +22,7 @@ SERVICE_RELOAD, ) from homeassistant.core import Event as HAEvent, HomeAssistant, ServiceCall -from homeassistant.core_config import Config +from homeassistant.helpers.typing import ConfigType from homeassistant.exceptions import HomeAssistantError import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import DATA_RESTORE_STATE @@ -65,7 +65,7 @@ CONFIG_SCHEMA = vol.Schema({DOMAIN: PYSCRIPT_SCHEMA}, extra=vol.ALLOW_EXTRA) -async def async_setup(hass: HomeAssistant, config: Config) -> bool: +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Component setup, run import config flow for each entry in config.""" await restore_state(hass) if DOMAIN in config: