Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import of Config for HA 2024.11.0b0 #746

Closed
wants to merge 1 commit into from

Conversation

rccoleman
Copy link

The Config class moved to homeassistant.core_config in 2024.11.0b0.

The Config class moved to homeassistant.core_config in 2024.11.0b0.
@@ -26,7 +26,8 @@
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_MODEL, CONF_HOST, CONF_URL
from homeassistant.core import Config, HomeAssistant, callback, valid_entity_id
from homeassistant.core import HomeAssistant, callback, valid_entity_id
from homeassistant.core_config import Config
Copy link

@MartinHjelmare MartinHjelmare Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only used for typing the parameter in async_setup, we can probably remove it. That parameter isn't an instance of Config.

Either use dict[str, Any] or ConfigType.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So add
from homeassistant.helpers.typing import ConfigType
and change line 176 to
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make the change work currently we would need to update the required home assistant version. I think it would be best to just remove the usage of Config since it was only used as a type

@tjorim tjorim mentioned this pull request Oct 30, 2024
@NickM-27 NickM-27 closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants