parent
28eb4f3dff
commit
5458ee2fa9
|
@ -9,12 +9,7 @@ from typing import Any
|
|||
from aioimaplib import AioImapException
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import (
|
||||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_PASSWORD,
|
||||
|
@ -35,6 +30,7 @@ from homeassistant.helpers.selector import (
|
|||
)
|
||||
from homeassistant.util.ssl import SSLCipherList
|
||||
|
||||
from . import ImapConfigEntry
|
||||
from .const import (
|
||||
CONF_CHARSET,
|
||||
CONF_CUSTOM_EVENT_DATA_TEMPLATE,
|
||||
|
@ -212,7 +208,7 @@ class IMAPConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@staticmethod
|
||||
@callback
|
||||
def async_get_options_flow(
|
||||
config_entry: ConfigEntry,
|
||||
config_entry: ImapConfigEntry,
|
||||
) -> ImapOptionsFlow:
|
||||
"""Get the options flow for this handler."""
|
||||
return ImapOptionsFlow()
|
||||
|
|
|
@ -14,7 +14,6 @@ from typing import TYPE_CHECKING, Any
|
|||
|
||||
from aioimaplib import AUTH, IMAP4_SSL, NONAUTH, SELECTED, AioImapException
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONF_PASSWORD,
|
||||
CONF_PORT,
|
||||
|
@ -53,6 +52,9 @@ from .const import (
|
|||
)
|
||||
from .errors import InvalidAuth, InvalidFolder
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import ImapConfigEntry
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
BACKOFF_TIME = 10
|
||||
|
@ -210,14 +212,14 @@ class ImapMessage:
|
|||
class ImapDataUpdateCoordinator(DataUpdateCoordinator[int | None]):
|
||||
"""Base class for imap client."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
config_entry: ImapConfigEntry
|
||||
custom_event_template: Template | None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
imap_client: IMAP4_SSL,
|
||||
entry: ConfigEntry,
|
||||
entry: ImapConfigEntry,
|
||||
update_interval: timedelta | None,
|
||||
) -> None:
|
||||
"""Initiate imap client."""
|
||||
|
@ -391,7 +393,7 @@ class ImapPollingDataUpdateCoordinator(ImapDataUpdateCoordinator):
|
|||
"""Class for imap client."""
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, imap_client: IMAP4_SSL, entry: ConfigEntry
|
||||
self, hass: HomeAssistant, imap_client: IMAP4_SSL, entry: ImapConfigEntry
|
||||
) -> None:
|
||||
"""Initiate imap client."""
|
||||
_LOGGER.debug(
|
||||
|
@ -437,7 +439,7 @@ class ImapPushDataUpdateCoordinator(ImapDataUpdateCoordinator):
|
|||
"""Class for imap client."""
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, imap_client: IMAP4_SSL, entry: ConfigEntry
|
||||
self, hass: HomeAssistant, imap_client: IMAP4_SSL, entry: ImapConfigEntry
|
||||
) -> None:
|
||||
"""Initiate imap client."""
|
||||
_LOGGER.debug("Connected to server %s using IMAP push", entry.data[CONF_SERVER])
|
||||
|
|
Loading…
Reference in New Issue