Voltage and Current Sensors support with PDDF#22444
Merged
Praveen-Brcm merged 1 commit intosonic-net:masterfrom May 23, 2025
Merged
Conversation
The committers listed above are authorized under a signed CLA. |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
@FuzailBrcm to have broadcom team review as well |
Contributor
Author
|
@judyjoseph @FuzailBrcm any updates on this? Thanks |
FuzailBrcm
approved these changes
May 23, 2025
Contributor
FuzailBrcm
left a comment
There was a problem hiding this comment.
Changes look good to me
Praveen-Brcm
approved these changes
May 23, 2025
geans-pin
reviewed
Jun 12, 2025
| raise ValueError(f"Current sensor {self.sensor_obj_name} not found in PDDF data") | ||
|
|
||
| self.sensor_obj = self.pddf_obj.data[self.sensor_obj_name] | ||
| self.display_name = self.sensor_data.get('dev_attr', {}).get('display_name', self.sensor_obj_name) |
Contributor
There was a problem hiding this comment.
There is a typo error in line 27. The self.display_name = self.sensor_data.get should change to self.display_name = self.sensor_obj.get
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.
Why I did it
Sensormon is currently not integrated with PDDF. Adding voltage and current sensor monitoring with PDDF support in order to expose system-level current and voltage readouts from peripheral sensors.
Fixes #17032
Work item tracking
How I did it
Implement pddf parsing for current and voltage sensors, as well as pddf_voltage_sensor and pddf_current_sensor classes.
How to verify it
Run commands "show platform voltage" and "show platform current".
Should see "Sensor not detected" for platforms that do not have current/voltage sensors implemented.
For platforms that do have it implemented, should see an output like this:
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)