Support reloading the universal platform (#39248)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-08-26 00:25:15 +02:00
1 parent 63ebea1706
commit 90842fcb84
18 files changed
+300 -82

No files matched your search

+4 -4
View File
@@ -26,7 +26,7 @@ from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.restore_state import RestoreEntity
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
@@ -55,7 +55,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
)
async def async_create_entities(hass, config):
async def _async_create_entities(hass, config):
"""Create the Template switches."""
switches = []
@@ -90,8 +90,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 switches."""
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 SwitchTemplate(TemplateEntity, SwitchEntity, RestoreEntity):