diff --git a/homeassistant/components/cert_expiry/config_flow.py b/homeassistant/components/cert_expiry/config_flow.py index 78450d247b9..14532aea65f 100644 --- a/homeassistant/components/cert_expiry/config_flow.py +++ b/homeassistant/components/cert_expiry/config_flow.py @@ -2,13 +2,14 @@ import logging import socket import ssl + import voluptuous as vol from homeassistant import config_entries -from homeassistant.const import CONF_PORT, CONF_NAME, CONF_HOST +from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT from homeassistant.core import HomeAssistant, callback -from .const import DOMAIN, DEFAULT_PORT, DEFAULT_NAME +from .const import DEFAULT_NAME, DEFAULT_PORT, DOMAIN from .helper import get_cert _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/cert_expiry/sensor.py b/homeassistant/components/cert_expiry/sensor.py index 3022c7bd42b..3a76575dfdd 100644 --- a/homeassistant/components/cert_expiry/sensor.py +++ b/homeassistant/components/cert_expiry/sensor.py @@ -1,24 +1,24 @@ """Counter for the days until an HTTPS (TLS) certificate will expire.""" +from datetime import datetime, timedelta import logging import socket import ssl -from datetime import datetime, timedelta import voluptuous as vol -import homeassistant.helpers.config_validation as cv -from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.components.sensor import PLATFORM_SCHEMA +from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( - CONF_NAME, CONF_HOST, + CONF_NAME, CONF_PORT, EVENT_HOMEASSISTANT_START, ) from homeassistant.core import callback +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity -from .const import DOMAIN, DEFAULT_NAME, DEFAULT_PORT +from .const import DEFAULT_NAME, DEFAULT_PORT, DOMAIN from .helper import get_cert _LOGGER = logging.getLogger(__name__) diff --git a/tests/components/cert_expiry/test_config_flow.py b/tests/components/cert_expiry/test_config_flow.py index 3754551c230..bcd1482195d 100644 --- a/tests/components/cert_expiry/test_config_flow.py +++ b/tests/components/cert_expiry/test_config_flow.py @@ -1,13 +1,14 @@ """Tests for the Cert Expiry config flow.""" -import pytest -import ssl import socket +import ssl from unittest.mock import patch +import pytest + from homeassistant import data_entry_flow from homeassistant.components.cert_expiry import config_flow from homeassistant.components.cert_expiry.const import DEFAULT_NAME, DEFAULT_PORT -from homeassistant.const import CONF_PORT, CONF_NAME, CONF_HOST +from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT from tests.common import MockConfigEntry, mock_coro