Add problematic electrical component connections hierarchy#235
Merged
Conversation
f7cfdb8 to
c0a030c
Compare
This is a new abstract base class that will be used to mirror the `ElectricalComponent` class hierarchy. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Added a new `ProblematicElectricalComponentConnection` class hierarchy. For now only one sub-class is provided: `SelfReferencingElectricalComponentConnection`, where the `source` and `destination` point to the same ID. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Added a new `ProblematicElectricalComponentConnectionTypes` and `ElectricalComponentConnectionTypes` type aliases to mirror the type aliases available for electrical components. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Update `electrical_component_connection_from_proto()` to return `ElectricalComponentConnectionTypes`, instantiating a `SelfReferencingElectricalComponentConnection` when a self referencing connection is detected instead of returning `None`, mirroring what we do for electrical components. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
c0a030c to
23a6cf6
Compare
daniel-zullo-frequenz
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I only found a couple of cosmetics in the new files copyright header
Co-authored-by: daniel-zullo-frequenz <120166726+daniel-zullo-frequenz@users.noreply.github.com> Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Co-authored-by: daniel-zullo-frequenz <120166726+daniel-zullo-frequenz@users.noreply.github.com> Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
daniel-zullo-frequenz
approved these changes
Jul 7, 2026
Contributor
Author
|
Oh, damn, I wanted to squash the commits :P |
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 PR brings the electrical component connection closer to the electrical component class hierarchy, adding problematic electrical component connections and a base class.
With this clients have full control over what is received from the API, having the change to act on problematic connections instead of them being implicitly dropped.