-
-
Notifications
You must be signed in to change notification settings - Fork 429
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 accepted types to ProfileContext #2814
Conversation
Signed-off-by: Jan N. Klug <github@klug.nrw>
a72c1d3
to
e538140
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.
I second your doubt on the different implementations of the ProfileContext
interface but agree on the default methods.
public ProfileContextImpl(Configuration configuration) { | ||
this.configuration = configuration; | ||
this.acceptedDataTypes = List.of(); | ||
this.acceptedCommandTypes = List.of(); | ||
} |
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.
Should we reuse the second ctor here?
public ProfileContextImpl(Configuration configuration) { | |
this.configuration = configuration; | |
this.acceptedDataTypes = List.of(); | |
this.acceptedCommandTypes = List.of(); | |
} | |
public ProfileContextImpl(Configuration configuration) { | |
this(configuration, List.of(), List.of()); | |
} |
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.
Done.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Add accepted types to ProfileContext Signed-off-by: Jan N. Klug <github@klug.nrw> GitOrigin-RevId: 73b76fa
I'm working on a very generic script profile which can be used with every item type. E.g. a script could half all commands from the handler to the item. Since a
Dimmer
channel accepts different item types, I need to know which types are accepted by the receiving item. This could e.g. also be used to link aString
channel (containing a JSON array as result of an HTTP request) to anNumber
item (for element count in the array).Even tough I doubt that there are other implementations of
ProfileContext
out there, I decided to keep it backward compatible and make the implementation of the newly introduced methods optional. If you don't mind the breaking change, I can easily remove them.Signed-off-by: Jan N. Klug github@klug.nrw