Closed elcajon closed 3 weeks ago
Thanks for the PR.
So importing directly from homeassistant.core_config
isn't the correct way? I can only find references to core_config. Where did you get the reference to helpers.typing from?
So importing directly from
homeassistant.core_config
isn't the correct way?
According to the HA dev draft blog post it is not the correct way if it is only used for async_setup.
Normally, integrations won't need to use the core
Config
class. But there's been custom integrations that have incorrect type annotations where theconfig
object passed to the integration'sasync_setup
is specified as aConfig
instance:A correct type annotation would be like this:
from homeassistant.helpers.typing import ConfigType
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the integration."""
Ah, I missed this one. Thanks for the explanation!
SSIA for reference https://github.com/home-assistant/developers.home-assistant/pull/2433/files