diff --git a/custom_components/mail_and_packages/binary_sensor.py b/custom_components/mail_and_packages/binary_sensor.py index 95089d9d..b8d8fadb 100644 --- a/custom_components/mail_and_packages/binary_sensor.py +++ b/custom_components/mail_and_packages/binary_sensor.py @@ -4,7 +4,6 @@ from homeassistant.components.binary_sensor import ( BinarySensorEntity, - BinarySensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST @@ -14,6 +13,7 @@ ) from .const import BINARY_SENSORS, COORDINATOR, DOMAIN, VERSION +from .entity import MailandPackagesBinarySensorEntityDescription _LOGGER = logging.getLogger(__name__) @@ -34,7 +34,7 @@ class PackagesBinarySensor(CoordinatorEntity, BinarySensorEntity): def __init__( self, - sensor_description: BinarySensorEntityDescription, + sensor_description: MailandPackagesBinarySensorEntityDescription, coordinator: DataUpdateCoordinator, config: ConfigEntry, ) -> None: diff --git a/custom_components/mail_and_packages/helpers.py b/custom_components/mail_and_packages/helpers.py index 68ac1af0..f600fba6 100644 --- a/custom_components/mail_and_packages/helpers.py +++ b/custom_components/mail_and_packages/helpers.py @@ -483,15 +483,15 @@ def login( try: if security == "SSL": if not verify: - context = ssl.client_context_no_verify() + context = ssl.get_default_no_verify_context() else: - context = ssl.client_context() + context = ssl.get_default_context() account = imaplib.IMAP4_SSL(host=host, port=port, ssl_context=context) elif security == "startTLS": if not verify: - context = ssl.client_context_no_verify() + context = ssl.get_default_no_verify_context() else: - context = ssl.client_context() + context = ssl.get_default_context() account = imaplib.IMAP4(host=host, port=port) account.starttls(context) else: