mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Update scaffold to use internal _PLATFORM constant (#135177)
This commit is contained in:
parent
1550086dd6
commit
e9616f38d8
@ -8,7 +8,7 @@ from homeassistant.core import HomeAssistant
|
||||
|
||||
# TODO List the platforms that you want to support.
|
||||
# For your initial PR, limit it to 1 platform.
|
||||
PLATFORMS: list[Platform] = [Platform.LIGHT]
|
||||
_PLATFORMS: list[Platform] = [Platform.LIGHT]
|
||||
|
||||
# TODO Create ConfigEntry type alias with API object
|
||||
# TODO Rename type alias and update all entry annotations
|
||||
@ -24,7 +24,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) ->
|
||||
# TODO 3. Store an API object for your platforms to access
|
||||
# entry.runtime_data = MyAPI(...)
|
||||
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)
|
||||
|
||||
return True
|
||||
|
||||
@ -32,4 +32,4 @@ async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) ->
|
||||
# TODO Update entry annotation
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: New_NameConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
return await hass.config_entries.async_unload_platforms(entry, _PLATFORMS)
|
||||
|
@ -8,7 +8,7 @@ from homeassistant.core import HomeAssistant
|
||||
|
||||
# TODO List the platforms that you want to support.
|
||||
# For your initial PR, limit it to 1 platform.
|
||||
PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR]
|
||||
_PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR]
|
||||
|
||||
# TODO Create ConfigEntry type alias with API object
|
||||
# Alias name should be prefixed by integration name
|
||||
@ -24,7 +24,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
# TODO 3. Store an API object for your platforms to access
|
||||
# entry.runtime_data = MyAPI(...)
|
||||
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)
|
||||
|
||||
return True
|
||||
|
||||
@ -32,4 +32,4 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
# TODO Update entry annotation
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
return await hass.config_entries.async_unload_platforms(entry, _PLATFORMS)
|
||||
|
@ -11,7 +11,7 @@ from . import api
|
||||
|
||||
# TODO List the platforms that you want to support.
|
||||
# For your initial PR, limit it to 1 platform.
|
||||
PLATFORMS: list[Platform] = [Platform.LIGHT]
|
||||
_PLATFORMS: list[Platform] = [Platform.LIGHT]
|
||||
|
||||
# TODO Create ConfigEntry type alias with ConfigEntryAuth or AsyncConfigEntryAuth object
|
||||
# TODO Rename type alias and update all entry annotations
|
||||
@ -37,7 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) ->
|
||||
aiohttp_client.async_get_clientsession(hass), session
|
||||
)
|
||||
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)
|
||||
|
||||
return True
|
||||
|
||||
@ -45,4 +45,4 @@ async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) ->
|
||||
# TODO Update entry annotation
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: New_NameConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
return await hass.config_entries.async_unload_platforms(entry, _PLATFORMS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user