mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
Enable basic type checking for cert_expiry (#55335)
This commit is contained in:
parent
fd66120d6d
commit
8b436c43f7
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||||
@ -44,7 +45,7 @@ async def async_unload_entry(hass, entry):
|
|||||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
|
||||||
|
|
||||||
class CertExpiryDataUpdateCoordinator(DataUpdateCoordinator[datetime]):
|
class CertExpiryDataUpdateCoordinator(DataUpdateCoordinator[Optional[datetime]]):
|
||||||
"""Class to manage fetching Cert Expiry data from single endpoint."""
|
"""Class to manage fetching Cert Expiry data from single endpoint."""
|
||||||
|
|
||||||
def __init__(self, hass, host, port):
|
def __init__(self, hass, host, port):
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Config flow for the Cert Expiry platform."""
|
"""Config flow for the Cert Expiry platform."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -25,7 +27,7 @@ class CertexpiryConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the config flow."""
|
"""Initialize the config flow."""
|
||||||
self._errors = {}
|
self._errors: dict[str, str] = {}
|
||||||
|
|
||||||
async def _test_connection(self, user_input=None):
|
async def _test_connection(self, user_input=None):
|
||||||
"""Test connection to the server and try to get the certificate."""
|
"""Test connection to the server and try to get the certificate."""
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -1285,9 +1285,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.bmw_connected_drive.*]
|
[mypy-homeassistant.components.bmw_connected_drive.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.cert_expiry.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.climacell.*]
|
[mypy-homeassistant.components.climacell.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.awair.*",
|
"homeassistant.components.awair.*",
|
||||||
"homeassistant.components.blueprint.*",
|
"homeassistant.components.blueprint.*",
|
||||||
"homeassistant.components.bmw_connected_drive.*",
|
"homeassistant.components.bmw_connected_drive.*",
|
||||||
"homeassistant.components.cert_expiry.*",
|
|
||||||
"homeassistant.components.climacell.*",
|
"homeassistant.components.climacell.*",
|
||||||
"homeassistant.components.cloud.*",
|
"homeassistant.components.cloud.*",
|
||||||
"homeassistant.components.config.*",
|
"homeassistant.components.config.*",
|
||||||
|
Loading…
Reference in New Issue
Block a user