From d9c434f5d436ed8c683350eb71da8d7700e07704 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 16 Sep 2026 12:19:25 +0200 Subject: [PATCH] fix(devices): preserve charge-rate typing and public import compatibility --- src/akkudoktoreos/devices/devices.py | 5 ++++- src/akkudoktoreos/devices/settings/batterysettings.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/akkudoktoreos/devices/devices.py b/src/akkudoktoreos/devices/devices.py index 71efb4f3..1575bc5b 100644 --- a/src/akkudoktoreos/devices/devices.py +++ b/src/akkudoktoreos/devices/devices.py @@ -11,7 +11,10 @@ from akkudoktoreos.core.cache import CacheFileStore from akkudoktoreos.core.coreabc import ConfigMixin, SingletonMixin from akkudoktoreos.core.emplan import ResourceStatus from akkudoktoreos.core.pydantic import ConfigDict, PydanticBaseModel -from akkudoktoreos.devices.settings.batterysettings import BatteriesCommonSettings +from akkudoktoreos.devices.settings.batterysettings import ( + BATTERY_DEFAULT_CHARGE_RATES as BATTERY_DEFAULT_CHARGE_RATES, + BatteriesCommonSettings, +) from akkudoktoreos.devices.settings.homeappliancesettings import ( HomeApplianceCommonSettings, ) diff --git a/src/akkudoktoreos/devices/settings/batterysettings.py b/src/akkudoktoreos/devices/settings/batterysettings.py index 8438c884..841f68df 100644 --- a/src/akkudoktoreos/devices/settings/batterysettings.py +++ b/src/akkudoktoreos/devices/settings/batterysettings.py @@ -238,7 +238,7 @@ class BatteriesCommonSettings(DevicesBaseSettings): def validate_and_sort_charge_rates(cls, v: Any) -> NDArray[Shape["*"], float]: # None means fallback to default values if v is None: - return BATTERY_DEFAULT_CHARGE_RATES.copy() + return np.asarray(BATTERY_DEFAULT_CHARGE_RATES, dtype=float).copy() # Convert to numpy array if isinstance(v, str):