-
Notifications
You must be signed in to change notification settings - Fork 354
Add on_set_value_callbacks to State and Command Interface #2365
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
Add on_set_value_callbacks to State and Command Interface #2365
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2365 +/- ##
==========================================
+ Coverage 88.90% 88.94% +0.04%
==========================================
Files 148 148
Lines 16937 16982 +45
Branches 1443 1447 +4
==========================================
+ Hits 15058 15105 +47
+ Misses 1315 1313 -2
Partials 564 564
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
The changes LGTM, but I'm not really sure if we should add this level of complexity or improve controller chaining with filter plugins to achieve the same. Would like to hear other opinions on that
I also thought the same at the beginning, but then thinking a bit. I realized that the chaining is completely configuration dependent on the control strategy. If the controller chaining or HW (The owner of the Command and State Interface) expect some kind of filtering, they cannot always expect that the other party always respects that. In that case, the one who is responsible of handling these value will have to filter them again just to make sure, and the approach proposed in the PR makes it simpler by defining the callbacks. This is one of the things we added to the Kilted roadmap |
This pull request is in conflict. Could you fix it @saikishor? |
We discussed at the last PMC meeting that we'll close this PR for now. |
This PR opens a possibility to add on_set_value_callback to the State and Command Interfaces, so we can simply add filters or pre-process the data before setting the value. This is helpful when you get references, and when they do not meet certain conditions, you process them and set the right value.