Repository navigation
Config Entry methods in __init__ should succeed or raise #1463
BackgroundAll the integrations Config entry methods in This is legacy and originates from when an integration logged an issue/exception (swallowed it) and returned a In the meantime the concept of ProposalDeprecate the returning of a boolean, either the method succeeds ( Most (my spy tells me there is 3 core integrations returning Methods considered to change:
Post deprecation: class ComponentProtocol(Protocol):
"""Define the format of an integration."""
async def async_setup_entry(
self, hass: HomeAssistant, config_entry: ConfigEntry
) -> None:
"""Set up a config entry."""
async def async_unload_entry(
self, hass: HomeAssistant, config_entry: ConfigEntry
) -> None:
"""Unload a config entry."""
async def async_migrate_entry(
self, hass: HomeAssistant, config_entry: ConfigEntry
) -> None:AlternativesThis pattern has been there since config entries was invented and lots of custom components use it that might not get updated timely enough. |
Replies: 1 comment
|
This proposal was discussed in the core architecture meeting and it has been approved with the condition that we implement it with backwards compatibility handling like the "Alternatives" section describes. We will deprecate the pattern for core integrations, but for custom integrations, we will indefinitely support a fallback which translates |
This proposal was discussed in the core architecture meeting and it has been approved with the condition that we implement it with backwards compatibility handling like the "Alternatives" section describes.
We will deprecate the pattern for core integrations, but for custom integrations, we will indefinitely support a fallback which translates
return Falseto aConfigEntryErrorwith a generic message.