Skip to content

Commit 0359bac

Browse files
committed
Fix bug in _battery_manager.py
A function's existence was being checked rather than its (boolean) result. This wasn't an issue in practice, because ever since we've had the PowerManager, the PowerDistributor has not received requests when there's no data. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 695bb91 commit 0359bac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frequenz/sdk/actor/power_distributing/_component_managers/_battery_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ def _get_battery_inverter_data(
446446
# This should be handled by BatteryStatus. BatteryStatus should not return
447447
# this batteries as working.
448448
if not all(
449-
self._battery_caches[bat_id].has_value for bat_id in battery_ids
449+
self._battery_caches[bat_id].has_value() for bat_id in battery_ids
450450
) or not all(
451-
self._inverter_caches[inv_id].has_value for inv_id in inverter_ids
451+
self._inverter_caches[inv_id].has_value() for inv_id in inverter_ids
452452
):
453453
_logger.error(
454454
"Battery %s or inverter %s send no data, yet. They should be not used.",

0 commit comments

Comments
 (0)