Fix types for shell command (#50004)

This commit is contained in:
Dermot Duffy 2021-05-03 01:43:23 -07:00 committed by GitHub
parent 9d08178ed1
commit e8446cb4d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,6 @@
"""Expose regular shell commands as services.""" """Expose regular shell commands as services."""
from __future__ import annotations
import asyncio import asyncio
from contextlib import suppress from contextlib import suppress
import logging import logging
@ -26,7 +28,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the shell_command component.""" """Set up the shell_command component."""
conf = config.get(DOMAIN, {}) conf = config.get(DOMAIN, {})
cache = {} cache: dict[str, tuple[str, str | None, template.Template | None]] = {}
async def async_service_handler(service: ServiceCall) -> None: async def async_service_handler(service: ServiceCall) -> None:
"""Execute a shell command service.""" """Execute a shell command service."""
@ -89,7 +91,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
) )
if process: if process:
with suppress(TypeError): with suppress(TypeError):
await process.kill() process.kill()
del process del process
return return

File diff suppressed because one or more lines are too long

View File

@ -192,7 +192,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.sentry.*", "homeassistant.components.sentry.*",
"homeassistant.components.sesame.*", "homeassistant.components.sesame.*",
"homeassistant.components.sharkiq.*", "homeassistant.components.sharkiq.*",
"homeassistant.components.shell_command.*",
"homeassistant.components.shelly.*", "homeassistant.components.shelly.*",
"homeassistant.components.sma.*", "homeassistant.components.sma.*",
"homeassistant.components.smart_meter_texas.*", "homeassistant.components.smart_meter_texas.*",