Support reloading the universal platform (#39248)
This commit is contained in:
parent
63ebea1706
commit
90842fcb84
18 changed files with 300 additions and 82 deletions
|
@ -37,7 +37,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.helpers.script import Script
|
||||
|
||||
from . import async_setup_platform_reloadable
|
||||
from . import async_setup_reload_service
|
||||
from .const import CONF_AVAILABILITY_TEMPLATE
|
||||
from .template_entity import TemplateEntity
|
||||
|
||||
|
@ -100,7 +100,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
async def async_create_entities(hass, config):
|
||||
async def _async_create_entities(hass, config):
|
||||
"""Create the Template cover."""
|
||||
covers = []
|
||||
|
||||
|
@ -152,8 +152,8 @@ async def async_create_entities(hass, config):
|
|||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
"""Set up the Template cover."""
|
||||
|
||||
await async_setup_platform_reloadable(hass)
|
||||
async_add_entities(await async_create_entities(hass, config))
|
||||
await async_setup_reload_service(hass)
|
||||
async_add_entities(await _async_create_entities(hass, config))
|
||||
|
||||
|
||||
class CoverTemplate(TemplateEntity, CoverEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue