Improve notify type hints in integrations (#90034)

This commit is contained in:
epenet 2023-03-21 11:40:19 +01:00 committed by GitHub
parent 86b4354477
commit 33e698d67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -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: