Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request restores sensor support that was temporarily removed in v0.18.0. The sensor API has been redesigned to align with the updated component and metrics model introduced in v0.18.0, providing a more consistent interface for working with environmental sensors in microgrids.
Key Changes
- Added new
sensormodule with redesigned sensor types (Sensor,SensorTelemetry,SensorStateSnapshot,SensorDiagnostic, etc.) - Implemented
list_sensors()method to fetch sensor metadata - Implemented
receive_sensor_telemetry_stream()method to stream real-time sensor telemetry data
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/frequenz/client/microgrid/_client.py |
Added sensor streaming and listing methods to MicrogridApiClient; updated broadcaster type hints |
src/frequenz/client/microgrid/__init__.py |
Minor formatting change (removed blank line) |
src/frequenz/client/microgrid/sensor/__init__.py |
New module initialization exporting all sensor-related types |
src/frequenz/client/microgrid/sensor/_sensor.py |
Core Sensor dataclass representing physical measurement devices |
src/frequenz/client/microgrid/sensor/_sensor_proto.py |
Protobuf conversion functions for Sensor objects |
src/frequenz/client/microgrid/sensor/_state.py |
State-related types including SensorStateSnapshot and diagnostic codes |
src/frequenz/client/microgrid/sensor/_state_proto.py |
Protobuf conversion for sensor state types |
src/frequenz/client/microgrid/sensor/_telemetry.py |
SensorTelemetry dataclass containing sensor measurements and state snapshots |
src/frequenz/client/microgrid/sensor/_telemetry_proto.py |
Protobuf conversion for sensor telemetry data |
tests/test_client.py |
Added test cases for new sensor API methods |
tests/sensor/test_*.py |
Comprehensive unit tests for all sensor types and proto conversions |
tests/client_test_cases/list_sensors/*.py |
Integration test cases for sensor listing functionality |
tests/client_test_cases/receive_sensor_telemetry_stream/*.py |
Integration test cases for sensor telemetry streaming |
RELEASE_NOTES.md |
Detailed migration guide from v0.9 to v0.18.2 sensor API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Marenz
previously approved these changes
Dec 18, 2025
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Now that all symbols are defined, we can enhance the module-level documentation to provide a clearer overview of the package's purpose and the data structures it offers for handling sensor telemetry. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
And leave them ready for the v0.18.2 release. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Contributor
Author
|
Updated to apply all copilot suggestions cleanly, and additionally:
|
Marenz
approved these changes
Dec 18, 2025
Contributor
Author
|
@tiyash-basu-frequenz let me know if I should wait for your review or if I should merge and release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request restores sensor support that was temporarily removed in v0.18.0. The sensor API has been redesigned to align with the updated component and metrics model introduced in v0.18.0, providing a more consistent interface for working with environmental sensors in microgrids.
Fixes #211.