-
Notifications
You must be signed in to change notification settings - Fork 5
Implement ReceiveComponentDataStreamRequest
#178
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
Conversation
This will be used to list electrical components. Signed-off-by: Leandro Lucarella <[email protected]>
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.
Pull Request Overview
This PR implements the ReceiveComponentDataStream RPC method, adding the ability to stream component data samples that include both metrics and state information. The implementation creates comprehensive wrapper classes for handling component data streaming.
- Adds
ComponentDataSamples,ComponentStateSample, andMetricSamplewrapper classes - Implements protobuf conversion functions with error handling and issue reporting
- Adds the
receive_component_data_samples_streammethod to the microgrid client - Includes comprehensive test coverage for all new functionality
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/frequenz/client/microgrid/_client.py |
Implements the main receive_component_data_samples_stream method with broadcaster management |
src/frequenz/client/microgrid/component/ |
Adds new wrapper classes and protobuf conversion functions |
src/frequenz/client/microgrid/metrics/ |
Extends metrics module with MetricSample class and protobuf conversion |
tests/ |
Comprehensive test coverage for all new classes and conversion functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@eduardiazf adding you because this is adding some wrappers for API common messages that I plan to move to
Bear in mind that these are for the Common API pre-v0.8, so some we'll need to make some renames before moving to Client Common. |
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
| Example: | ||
| A hybrid inverter can have a DC string for a battery and another DC string for a | ||
| PV array. The connection names could resemble, say, `dc_battery_0` and | ||
| ``dc_pv_0`. A metric like DC voltage can be obtained from both connections. For |
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.
| ``dc_pv_0`. A metric like DC voltage can be obtained from both connections. For | |
| `dc_pv_0`. A metric like DC voltage can be obtained from both connections. For |
|
|
||
| # In the protocol this is float | AggregatedMetricValue, but for live data we can't | ||
| # receive the AggregatedMetricValue, so we limit this to float for now. | ||
| value: float | AggregatedMetricValue | None |
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.
is the comment outdated?
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.
Yes, I think that comment was for before 0.17, will fix.
This PR implements the
ReceiveComponentDataStreamRequestrpc, and for that it adds wrappers forComponentDataSamples,ComponentStateSample, andMetricSample.