-
Notifications
You must be signed in to change notification settings - Fork 6
Restore sensor support #228
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
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 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.
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>
|
Updated to apply all copilot suggestions cleanly, and additionally:
|
|
@tiyash-basu-frequenz let me know if I should wait for your review or if I should merge and release. |
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.