Add Apprise to strict typing (#105575)

This commit is contained in:
Joost Lekkerkerker 2023-12-12 20:53:36 +01:00 committed by GitHub
parent 32147dbdd9
commit 09b07c071b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -63,6 +63,7 @@ homeassistant.components.analytics.*
homeassistant.components.anova.*
homeassistant.components.anthemav.*
homeassistant.components.apcupsd.*
homeassistant.components.apprise.*
homeassistant.components.aqualogic.*
homeassistant.components.aseko_pool_live.*
homeassistant.components.assist_pipeline.*

View File

@ -2,6 +2,7 @@
from __future__ import annotations
import logging
from typing import Any
import apprise
import voluptuous as vol
@ -61,11 +62,11 @@ def get_service(
class AppriseNotificationService(BaseNotificationService):
"""Implement the notification service for Apprise."""
def __init__(self, a_obj):
def __init__(self, a_obj: apprise.Apprise) -> None:
"""Initialize the service."""
self.apprise = a_obj
def send_message(self, message="", **kwargs):
def send_message(self, message: str = "", **kwargs: Any) -> None:
"""Send a message to a specified target.
If no target/tags are specified, then services are notified as is

View File

@ -390,6 +390,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.apprise.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.aqualogic.*]
check_untyped_defs = true
disallow_incomplete_defs = true