Use relative import paths

This commit is contained in:
Jules 2025-05-02 20:20:21 +02:00
parent 6476f0e57a
commit 1a33b3b594
Signed by: jdejaegh
GPG key ID: 99D6D184CA66933A
6 changed files with 14 additions and 14 deletions

View file

@ -10,7 +10,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import dt
from custom_components.irm_kmi import DOMAIN, IrmKmiCoordinator
from . import DOMAIN, IrmKmiCoordinator
_LOGGER = logging.getLogger(__name__)

View file

@ -14,7 +14,7 @@ from homeassistant.components.weather import (ATTR_CONDITION_CLEAR_NIGHT,
ATTR_CONDITION_SUNNY)
from homeassistant.const import Platform, UnitOfPressure, UnitOfSpeed, UnitOfTemperature, DEGREE
from custom_components.irm_kmi.irm_kmi_api.const import OPTION_STYLE_CONTRAST, OPTION_STYLE_YELLOW_RED, \
from .irm_kmi_api.const import OPTION_STYLE_CONTRAST, OPTION_STYLE_YELLOW_RED, \
OPTION_STYLE_SATELLITE, OPTION_STYLE_STD
DOMAIN: Final = 'irm_kmi'

View file

@ -14,12 +14,12 @@ from zoneinfo import ZoneInfo
import aiohttp
import async_timeout
from custom_components.irm_kmi.irm_kmi_api.const import WEEKDAYS, STYLE_TO_PARAM_MAP, OPTION_STYLE_SATELLITE, \
from .const import WEEKDAYS, STYLE_TO_PARAM_MAP, OPTION_STYLE_SATELLITE, \
MAP_WARNING_ID_TO_SLUG as SLUG_MAP
from custom_components.irm_kmi.irm_kmi_api.data import CurrentWeatherData, IrmKmiForecast, Forecast, \
from .data import CurrentWeatherData, IrmKmiForecast, Forecast, \
IrmKmiRadarForecast, RadarAnimationData, AnimationFrameData, WarningData
from custom_components.irm_kmi.irm_kmi_api.pollen import PollenParser
from custom_components.irm_kmi.utils import next_weekday
from .pollen import PollenParser
from .utils import next_weekday
_LOGGER = logging.getLogger(__name__)

View file

@ -1,2 +0,0 @@

View file

@ -0,0 +1,8 @@
from datetime import timedelta
def next_weekday(current, weekday):
days_ahead = weekday - current.weekday()
if days_ahead < 0:
days_ahead += 7
return current + timedelta(days_ahead)

View file

@ -1,5 +1,4 @@
import logging
from datetime import timedelta
from typing import Any
from homeassistant.config_entries import ConfigEntry
@ -41,8 +40,3 @@ def preferred_language(hass: HomeAssistant, config_entry: ConfigEntry) -> str:
return get_config_value(config_entry, CONF_LANGUAGE_OVERRIDE)
def next_weekday(current, weekday):
days_ahead = weekday - current.weekday()
if days_ahead < 0:
days_ahead += 7
return current + timedelta(days_ahead)