diff --git a/script/scaffold/templates/config_flow/integration/__init__.py b/script/scaffold/templates/config_flow/integration/__init__.py index dc92ecc1d15..704292a2e9b 100644 --- a/script/scaffold/templates/config_flow/integration/__init__.py +++ b/script/scaffold/templates/config_flow/integration/__init__.py @@ -14,7 +14,11 @@ PLATFORMS: list[Platform] = [Platform.LIGHT] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up NEW_NAME from a config entry.""" - # TODO Store an API object for your platforms to access + + hass.data.setdefault(DOMAIN, {}) + # TODO 1. Create API instance + # TODO 2. Validate the API connection (and authentication) + # TODO 3. Store an API object for your platforms to access # hass.data[DOMAIN][entry.entry_id] = MyApi(...) hass.config_entries.async_setup_platforms(entry, PLATFORMS) diff --git a/script/scaffold/templates/config_flow_discovery/integration/__init__.py b/script/scaffold/templates/config_flow_discovery/integration/__init__.py index d7fb1e56eef..73b4bebf9f5 100644 --- a/script/scaffold/templates/config_flow_discovery/integration/__init__.py +++ b/script/scaffold/templates/config_flow_discovery/integration/__init__.py @@ -14,7 +14,11 @@ PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up NEW_NAME from a config entry.""" - # TODO Store an API object for your platforms to access + + hass.data.setdefault(DOMAIN, {}) + # TODO 1. Create API instance + # TODO 2. Validate the API connection (and authentication) + # TODO 3. Store an API object for your platforms to access # hass.data[DOMAIN][entry.entry_id] = MyApi(...) hass.config_entries.async_setup_platforms(entry, PLATFORMS)