Sync ElectricalComponent with the protobuf message#216
Merged
Conversation
ElectricalComponent with the protobuf message
Contributor
Author
|
@tiyash-basu-frequenz I guess the new "model" field should be working by now and there is no need to keep the old "manufacturer" and "model_name" fields, right? Or should I leave them as deprecated as they are in the protobuf? |
af2033f to
a7f6353
Compare
The new field is indeed working now. |
The protobuf `ElectricalComponent` message has an `operational_mode` field typed as the `ElectricalComponentOperationalMode` enum, but the wrapper had no equivalent enum. Add the enum wrapper together with its `v1alpha8` `*_from_proto`/`*_to_proto` converters and parity test, following the existing enum conventions. This is a prerequisite for exposing the `ElectricalComponent.operational_mode` field in a follow-up commit. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
a7f6353 to
08193a2
Compare
Contributor
Author
|
Great. Rebased with resolved conflicts. |
The protobuf `ElectricalComponent` message has an `operational_mode` field (number 10) that was neither exposed on the wrapper nor read by the converter, losing data. Expose it as `ElectricalComponent.operational_mode` (defaulting to `UNSPECIFIED`) and populate it in `_ElectricalComponentBaseData` and every constructed component subclass. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The protobuf `ElectricalComponent` message has a `model` field (number 11) that was neither exposed on the wrapper nor read by the converter, losing data. This field is the non-deprecated replacement for `manufacturer` and `model_name`, so it is the most important of the three going forward. Expose it as `ElectricalComponent.model` and populate it in `_ElectricalComponentBaseData` and every constructed component subclass. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The wrapper field for the protobuf `metric_config_bounds` was named `rated_bounds`, which narrows the meaning. The proto describes configuration bounds that may be derived from the component configuration, manufacturer limits, or limits of other devices, not just rated limits. Rename the public `ElectricalComponent.rated_bounds` field (and the internal base-data plumbing and tests) to `metric_config_bounds` to match the protobuf semantics. The repeated-message-to-mapping conversion is unchanged. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Remove the deprecated wrapper fields that were superseded by the kept `model` field in unreleased code. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
08193a2 to
d9d325f
Compare
tiyash-basu-frequenz
approved these changes
Jun 17, 2026
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.
The protobuf have a few new and deprecated fields and one existing field had a name that doesn't match the protobuf name, which could lead to confusion.
Since this code is new, we completely remove the deprecated fields.
Part of #203.