Add the ability to reload command_line platforms from yaml (#39262)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-08-25 19:52:36 -05:00
1 parent 5018e53b33
commit 215e3f2dab
8 files changed
+70 -4

No files matched your search

@@ -17,9 +17,10 @@ from homeassistant.const import (
CONF_VALUE_TEMPLATE,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.reload import setup_reload_service
from . import call_shell_with_timeout, check_output_or_log
from .const import CONF_COMMAND_TIMEOUT, DEFAULT_TIMEOUT
from .const import CONF_COMMAND_TIMEOUT, DEFAULT_TIMEOUT, DOMAIN, PLATFORMS
_LOGGER = logging.getLogger(__name__)
@@ -41,6 +42,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Find and return switches controlled by shell commands."""
setup_reload_service(hass, DOMAIN, PLATFORMS)
devices = config.get(CONF_SWITCHES, {})
switches = []