mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +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 subprocess
|
||||
from typing import Any
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
@ -46,7 +47,7 @@ class CommandLineNotificationService(BaseNotificationService):
|
||||
self.command = command
|
||||
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."""
|
||||
with subprocess.Popen(
|
||||
self.command,
|
||||
|
@ -2,7 +2,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import TextIO
|
||||
from typing import Any, TextIO
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
@ -48,7 +48,7 @@ class FileNotificationService(BaseNotificationService):
|
||||
self.filename = filename
|
||||
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."""
|
||||
file: TextIO
|
||||
if not self.hass.config.config_dir:
|
||||
|
Loading…
x
Reference in New Issue
Block a user