From 673b11c252cdee347ebb66ca3404af7e8928b57d Mon Sep 17 00:00:00 2001 From: Jordan Harvey Date: Fri, 13 Sep 2024 23:11:50 +0000 Subject: [PATCH] fix lint errors --- custom_components/fuel_prices/__init__.py | 8 ++++---- custom_components/fuel_prices/config_flow.py | 1 - custom_components/fuel_prices/sensor.py | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/custom_components/fuel_prices/__init__.py b/custom_components/fuel_prices/__init__.py index 89a4e45..b7a8127 100644 --- a/custom_components/fuel_prices/__init__.py +++ b/custom_components/fuel_prices/__init__.py @@ -1,6 +1,5 @@ """Fuel Prices integration.""" -import contextlib import logging from datetime import timedelta @@ -30,20 +29,21 @@ from .const import DOMAIN, CONF_AREAS, CONF_SOURCES, CONF_CHEAPEST_SENSORS, CONF_CHEAPEST_SENSORS_COUNT, CONF_CHEAPEST_SENSORS_FUEL_TYPE from .coordinator import FuelPricesCoordinator -type FuelPricesConfigEntry = ConfigEntry[FuelPricesConfig] - _LOGGER = logging.getLogger(__name__) PLATFORMS = [Platform.SENSOR] @dataclass class FuelPricesConfig: - """Represent a config for Anglian Water.""" + """Represent a Fuel Price Config.""" coordinator: FuelPricesCoordinator areas: list[dict] +type FuelPricesConfigEntry = ConfigEntry[FuelPricesConfig] + + def _build_configured_areas(hass_areas: dict) -> list[dict]: module_areas = [] for area in hass_areas: diff --git a/custom_components/fuel_prices/config_flow.py b/custom_components/fuel_prices/config_flow.py index 84bb590..1eae642 100644 --- a/custom_components/fuel_prices/config_flow.py +++ b/custom_components/fuel_prices/config_flow.py @@ -2,7 +2,6 @@ import logging from typing import Any -from homeassistant.config_entries import ConfigEntry, OptionsFlow from pyfuelprices.sources.mapping import SOURCE_MAP, COUNTRY_MAP import voluptuous as vol diff --git a/custom_components/fuel_prices/sensor.py b/custom_components/fuel_prices/sensor.py index 612709d..584bf71 100644 --- a/custom_components/fuel_prices/sensor.py +++ b/custom_components/fuel_prices/sensor.py @@ -11,14 +11,12 @@ from homeassistant.components.sensor import SensorEntity from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS, CONF_NAME, STATE_UNKNOWN -from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from pyfuelprices.const import PROP_FUEL_LOCATION_SOURCE from . import FuelPricesConfigEntry -from .const import CONF_AREAS, DOMAIN, CONF_STATE_VALUE, CONF_CHEAPEST_SENSORS, CONF_CHEAPEST_SENSORS_COUNT, CONF_CHEAPEST_SENSORS_FUEL_TYPE +from .const import CONF_STATE_VALUE, CONF_CHEAPEST_SENSORS, CONF_CHEAPEST_SENSORS_COUNT, CONF_CHEAPEST_SENSORS_FUEL_TYPE from .entity import FuelStationEntity, CheapestFuelEntity -from .coordinator import FuelPricesCoordinator _LOGGER = logging.getLogger(__name__)