-
Notifications
You must be signed in to change notification settings - Fork 24
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
Reduce boilerplate when creating Devices #240
Conversation
7655d0b
to
6e8cf5c
Compare
94dff68
to
00d53af
Compare
I've restored the |
This reduces the amount of duplication and repetition when adding signals to a StandardReadable. As part of this, classes defining the types of signal have been created, which control the behaviour of the Signal being registered Signals must be registered either using the "add_children_as_readables" contextmanager, or the "add_readables" function.
Review done by Tom Cobb Includes: - Much refactoring of types - Allowing wrappers to be optional - Generate hints when requested, rather than in advance
Instead of assuming everything added inside the cm is a SignalR, we will instead filter the created attributes for only those we care for. This allows us to broaden how the context manager can be used; see sim_motor for an example.
May as well test a little more code here
It will issue a DeprecationWarning when used
f01dee3
to
e20915d
Compare
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.
Thanks, looks good!
This reduces the amount of duplication and repetition when adding signals to a StandardReadable.
As part of this, classes defining the types of signal have been created, which control the behaviour of the Signal being registered. See
ConfigSignal
andHintedSignal
.Signals should now be registered either using the "add_children_as_readables" contextmanager, or the "add_readables" function.
Fixes #223
NOTE: This deprecates the
set_readable_signals()
method inStandardReadable