Support reloading the universal platform (#39248)
This commit is contained in:
1 parent
63ebea1706
commit
90842fcb84
18 files changed
+300
-82
No files matched your search
@@ -26,7 +26,7 @@ from homeassistant.exceptions import TemplateError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity, async_generate_entity_id
|
||||
|
||||
from . import async_setup_platform_reloadable
|
||||
from . import async_setup_reload_service
|
||||
from .const import CONF_AVAILABILITY_TEMPLATE
|
||||
from .template_entity import TemplateEntity
|
||||
|
||||
@@ -57,7 +57,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
async def async_create_entities(hass, config):
|
||||
async def _async_create_entities(hass, config):
|
||||
"""Create the template sensors."""
|
||||
|
||||
sensors = []
|
||||
@@ -97,8 +97,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 sensors."""
|
||||
|
||||
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 SensorTemplate(TemplateEntity, Entity):
|
||||
|
||||
Reference in new issue
Block a user