-
Notifications
You must be signed in to change notification settings - Fork 348
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
base: master
Are you sure you want to change the base?
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.84% 88.89% +0.05%
==========================================
Files 148 148
Lines 16893 16938 +45
Branches 1438 1442 +4
==========================================
+ Hits 15008 15057 +49
+ Misses 1319 1316 -3
+ Partials 566 565 -1
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 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.