Add the ability to reload light/cover groups from yaml (#39250)
* Add the ability to reload light/cover groups from yaml Update previous usage to reduce code duplication. * Fix conflict from rebase
This commit is contained in:
1 parent
e109b04efe
commit
810df38f0d
16 files changed
+175
-56
No files matched your search
@@ -23,11 +23,11 @@ from homeassistant.core import callback
|
||||
from homeassistant.exceptions import TemplateError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import async_generate_entity_id
|
||||
from homeassistant.helpers.reload import async_setup_reload_service
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.script import Script
|
||||
|
||||
from . import async_setup_reload_service
|
||||
from .const import CONF_AVAILABILITY_TEMPLATE
|
||||
from .const import CONF_AVAILABILITY_TEMPLATE, DOMAIN, PLATFORMS
|
||||
from .template_entity import TemplateEntity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -90,7 +90,7 @@ 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_reload_service(hass)
|
||||
await async_setup_reload_service(hass, DOMAIN, PLATFORMS)
|
||||
async_add_entities(await _async_create_entities(hass, config))
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user