diff --git a/custom_components/ecotrend_ista/__init__.py b/custom_components/ecotrend_ista/__init__.py index edfbaee..ec6cd9d 100644 --- a/custom_components/ecotrend_ista/__init__.py +++ b/custom_components/ecotrend_ista/__init__.py @@ -5,6 +5,7 @@ import logging import voluptuous as vol + from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, Platform diff --git a/custom_components/ecotrend_ista/config_flow.py b/custom_components/ecotrend_ista/config_flow.py index 0a742ea..67af662 100644 --- a/custom_components/ecotrend_ista/config_flow.py +++ b/custom_components/ecotrend_ista/config_flow.py @@ -7,18 +7,15 @@ from types import MappingProxyType from typing import Any +from pyecotrend_ista.exception_classes import LoginError +from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta import requests import voluptuous as vol + from homeassistant import config_entries, core from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from homeassistant.data_entry_flow import FlowResult -from homeassistant.helpers.selector import ( - NumberSelector, - NumberSelectorConfig, - NumberSelectorMode, -) -from pyecotrend_ista.exception_classes import LoginError -from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta +from homeassistant.helpers.selector import NumberSelector, NumberSelectorConfig, NumberSelectorMode from .const import CONF_MFA, CONF_UPDATE_INTERVAL, CONF_URL, DOMAIN, MANUFACTURER from .const_schema import DATA_SCHEMA_EMAIL, URL_SELECTOR diff --git a/custom_components/ecotrend_ista/const_schema.py b/custom_components/ecotrend_ista/const_schema.py index b487570..aa00fb6 100644 --- a/custom_components/ecotrend_ista/const_schema.py +++ b/custom_components/ecotrend_ista/const_schema.py @@ -3,6 +3,7 @@ from __future__ import annotations import voluptuous as vol + from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, CONF_SCAN_INTERVAL from homeassistant.helpers.selector import ( NumberSelector, diff --git a/custom_components/ecotrend_ista/coordinator.py b/custom_components/ecotrend_ista/coordinator.py index ce49f68..47bf74d 100644 --- a/custom_components/ecotrend_ista/coordinator.py +++ b/custom_components/ecotrend_ista/coordinator.py @@ -3,18 +3,19 @@ from __future__ import annotations import datetime +from datetime import timedelta import json import logging import os -from datetime import timedelta from typing import Any +from pyecotrend_ista.helper_object_de import CustomRaw +from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta import requests + from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator -from pyecotrend_ista.helper_object_de import CustomRaw -from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta from .config_flow import login_account from .const import CONF_UPDATE_INTERVAL, DOMAIN diff --git a/custom_components/ecotrend_ista/entity.py b/custom_components/ecotrend_ista/entity.py index c80786d..68ef1e0 100644 --- a/custom_components/ecotrend_ista/entity.py +++ b/custom_components/ecotrend_ista/entity.py @@ -5,11 +5,7 @@ from dataclasses import dataclass from typing import Literal -from homeassistant.components.sensor import ( - SensorDeviceClass, - SensorEntityDescription, - SensorStateClass, -) +from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription, SensorStateClass from homeassistant.const import EntityCategory, UnitOfEnergy, UnitOfVolume from .const import ( diff --git a/custom_components/ecotrend_ista/sensor.py b/custom_components/ecotrend_ista/sensor.py index fe0c587..191641f 100644 --- a/custom_components/ecotrend_ista/sensor.py +++ b/custom_components/ecotrend_ista/sensor.py @@ -2,11 +2,14 @@ from __future__ import annotations +from collections.abc import Callable import datetime import logging -from collections.abc import Callable from typing import Any, cast +from pyecotrend_ista.helper_object_de import CustomRaw +from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta + from homeassistant.components.sensor import RestoreSensor, SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant @@ -15,8 +18,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType from homeassistant.helpers.update_coordinator import CoordinatorEntity -from pyecotrend_ista.helper_object_de import CustomRaw -from pyecotrend_ista.pyecotrend_ista import PyEcotrendIsta from .const import ( CONF_TYPE_HEATING_CUSTOM,