We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
None
1 parent 7555366 commit 21c96fbCopy full SHA for 21c96fb
src/frequenz/sdk/microgrid/_power_managing/_matryoshka.py
@@ -199,7 +199,15 @@ def calculate_target_power(
199
bucket = self._component_buckets.setdefault(component_ids, set())
200
if proposal in bucket:
201
bucket.remove(proposal)
202
- bucket.add(proposal)
+ if (
203
+ proposal.preferred_power is not None
204
+ or proposal.bounds.lower is not None
205
+ or proposal.bounds.upper is not None
206
+ ):
207
+ bucket.add(proposal)
208
+ elif not bucket:
209
+ del self._component_buckets[component_ids]
210
+ _ = self._target_power.pop(component_ids, None)
211
212
# If there has not been any proposal for the given components, don't calculate a
213
# target power and just return `None`.
0 commit comments