diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 12ec5e4364..33b06fb169 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -35,6 +35,7 @@ Bugfixes * Check read permissions for sensors referenced in forecasting and scheduling config payloads, and return a clearer 403 error when a referenced sensor is not readable [see `PR #2096 `_ and `PR #2125 `_] * Standardize resolution formatting across API endpoints for consistent response payloads [see `PR #2152 `_] * Make the auth check for CLI commands work with ``flask``, too, instead of only with the ``flexmeasures`` alias [see `PR #2169 `_] +* Fix ``StorageScheduler`` crash (``AttributeError: 'NoneType' object has no attribute 'event_resolution'``) when scheduling a site whose asset tree contains non-storage devices with only a ``power-capacity`` in their ``flex-model`` (no ``sensor`` key) [see `PR #2085 `_] v0.32.3 | May 15, 2026 @@ -118,7 +119,6 @@ Bugfixes v0.31.3 | April 11, 2026 -============================ Bugfixes ----------- diff --git a/flexmeasures/data/models/planning/storage.py b/flexmeasures/data/models/planning/storage.py index 93a67a3e96..7317003cf3 100644 --- a/flexmeasures/data/models/planning/storage.py +++ b/flexmeasures/data/models/planning/storage.py @@ -906,7 +906,7 @@ def _prepare(self, skip_validation: bool = False) -> tuple: # noqa: C901 device_constraints[d]["efficiency"] = storage_efficiency[d] # Convert efficiency from sensor resolution to scheduling resolution - if sensor_d.event_resolution != timedelta(0): + if sensor_d is not None and sensor_d.event_resolution != timedelta(0): device_constraints[d]["efficiency"] **= ( resolution / sensor_d.event_resolution )