Type check various base components (#25878)
* Type check various component base classes, disabling bunch of checks for now * Type hint fixes * Help mypy out some * Add more type hints
This commit is contained in:
1 parent
cf90e49b50
commit
b738082dad
59 files changed
+233
-34
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import asyncio
|
||||
import logging
|
||||
from functools import partial
|
||||
from typing import Optional
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
@@ -10,8 +11,12 @@ from homeassistant.exceptions import HomeAssistantError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
||||
from homeassistant.helpers import config_per_platform, discovery
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.util import slugify
|
||||
|
||||
|
||||
# mypy: allow-untyped-defs, no-check-untyped-defs
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# Platform specific data
|
||||
@@ -164,7 +169,7 @@ async def async_setup(hass, config):
|
||||
class BaseNotificationService:
|
||||
"""An abstract class for notification services."""
|
||||
|
||||
hass = None
|
||||
hass: Optional[HomeAssistantType] = None
|
||||
|
||||
def send_message(self, message, **kwargs):
|
||||
"""Send a message.
|
||||
|
||||
Reference in new issue
Block a user