parent
ea7b1e4573
commit
9aaf11de8c
54 changed files with 223 additions and 382 deletions
|
@ -27,15 +27,13 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
||||
async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
||||
"""Set up the shell_command component."""
|
||||
conf = config.get(DOMAIN, {})
|
||||
|
||||
cache = {}
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_service_handler(service: ServiceCall) -> None:
|
||||
async def async_service_handler(service: ServiceCall) -> None:
|
||||
"""Execute a shell command service."""
|
||||
cmd = conf[service.service]
|
||||
|
||||
|
@ -85,8 +83,8 @@ def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
|||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
process = yield from create_process
|
||||
stdout_data, stderr_data = yield from process.communicate()
|
||||
process = await create_process
|
||||
stdout_data, stderr_data = await process.communicate()
|
||||
|
||||
if stdout_data:
|
||||
_LOGGER.debug("Stdout of command: `%s`, return code: %s:\n%s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue