mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Improve notify type hints in integrations (#90034)
This commit is contained in:
parent
86b4354477
commit
33e698d67f
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ class CommandLineNotificationService(BaseNotificationService):
|
|||||||
self.command = command
|
self.command = command
|
||||||
self._timeout = timeout
|
self._timeout = timeout
|
||||||
|
|
||||||
def send_message(self, message="", **kwargs) -> None:
|
def send_message(self, message: str = "", **kwargs: Any) -> None:
|
||||||
"""Send a message to a command line."""
|
"""Send a message to a command line."""
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
self.command,
|
self.command,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from typing import TextIO
|
from typing import Any, TextIO
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ class FileNotificationService(BaseNotificationService):
|
|||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.add_timestamp = add_timestamp
|
self.add_timestamp = add_timestamp
|
||||||
|
|
||||||
def send_message(self, message="", **kwargs) -> None:
|
def send_message(self, message: str = "", **kwargs: Any) -> None:
|
||||||
"""Send a message to a file."""
|
"""Send a message to a file."""
|
||||||
file: TextIO
|
file: TextIO
|
||||||
if not self.hass.config.config_dir:
|
if not self.hass.config.config_dir:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user