-
Couldn't load subscription status.
- Fork 20
Allow create PVPool instances in locations without PV #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,15 +97,20 @@ def __init__( # pylint: disable=too-many-arguments | |
| name=f"System Bounds for PV inverters: {component_ids}", | ||
| resend_latest=True, | ||
| ) | ||
| self.bounds_tracker: PVSystemBoundsTracker = PVSystemBoundsTracker( | ||
| self.component_ids, | ||
| self.status_receiver, | ||
| self.bounds_channel.new_sender(), | ||
| ) | ||
| self.bounds_tracker.start() | ||
|
|
||
| self.bounds_tracker: PVSystemBoundsTracker | None = None | ||
| # In locations without PV inverters, the bounds tracker will not be started. | ||
| if self.component_ids: | ||
| self.bounds_tracker = PVSystemBoundsTracker( | ||
| self.component_ids, | ||
| self.status_receiver, | ||
| self.bounds_channel.new_sender(), | ||
| ) | ||
| self.bounds_tracker.start() | ||
|
|
||
| async def stop(self) -> None: | ||
| """Stop all tasks and channels owned by the PVInverterPool.""" | ||
| await self.formula_pool.stop() | ||
| await self.bounds_tracker.stop() | ||
| if self.bounds_tracker is not None: | ||
| await self.bounds_tracker.stop() | ||
|
Comment on lines
+114
to
+115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not introduced by this PR, but just FYI, as I mentioned in other insteances and at least if this is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not a bug the way it is now, at least not in this layer, because this is in the But we will have to look at the outer layers, where we just removed the call to |
||
| self.status_receiver.close() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding an inline comment to explain why bounds_tracker is initialized to None and conditionally set based on component_ids. This will help maintainers understand the intent behind this change.