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:
J. Nick Koston 2020-08-25 18:13:43 -05:00 committed by GitHub
parent e109b04efe
commit 810df38f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 175 additions and 56 deletions

View file

@ -24,10 +24,10 @@ from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.reload import async_setup_reload_service
from homeassistant.helpers.template import result_as_boolean
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__)
@ -97,7 +97,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 binary sensors."""
await async_setup_reload_service(hass)
await async_setup_reload_service(hass, DOMAIN, PLATFORMS)
async_add_entities(await _async_create_entities(hass, config))