mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Fix types for shell command (#50004)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""Expose regular shell commands as services."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from contextlib import suppress
|
||||
import logging
|
||||
@@ -26,7 +28,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the shell_command component."""
|
||||
conf = config.get(DOMAIN, {})
|
||||
|
||||
cache = {}
|
||||
cache: dict[str, tuple[str, str | None, template.Template | None]] = {}
|
||||
|
||||
async def async_service_handler(service: ServiceCall) -> None:
|
||||
"""Execute a shell command service."""
|
||||
@@ -89,7 +91,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
)
|
||||
if process:
|
||||
with suppress(TypeError):
|
||||
await process.kill()
|
||||
process.kill()
|
||||
del process
|
||||
|
||||
return
|
||||
|
@@ -192,7 +192,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.sentry.*",
|
||||
"homeassistant.components.sesame.*",
|
||||
"homeassistant.components.sharkiq.*",
|
||||
"homeassistant.components.shell_command.*",
|
||||
"homeassistant.components.shelly.*",
|
||||
"homeassistant.components.sma.*",
|
||||
"homeassistant.components.smart_meter_texas.*",
|
||||
|
Reference in New Issue
Block a user