Add set default for domain for scaffold script (#76628)

* Add set default for domain for scaffold script

* Add default domain for config_flow_discovery integration

* Extend comment explaining usage
This commit is contained in:
Tomasz Wieczorek 2022-08-29 00:02:27 +02:00 committed by GitHub
parent 7be6d6eba2
commit 50a1de9f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -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)

View file

@ -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)