-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bindings with several classes with the same thing action scope #17785
Comments
I assume the correct way is like it is done in |
Well @lolodomo , while I was on it I did it all. |
Note that changing the scope is a breaking change for users. For hue binding for example, I believe one is for API v1 and the other for API v2. @andrewfg can you please confirm. |
@clinique : bindings README should be updated as the new scope has to be mentioned for each action. |
This seems a bit counter-intuitive, I thought getActions was defined: but it's It's fine when there's only one action class that can define then for Caddx it would give: correct ? |
Yes, that's my understanding. |
Please make a test with freeboxos binding for example to confirm. |
I use rebootPlayer and rebootServer in Freeboxos, thus they had the same some and it used to work fine. |
This information is coming from @J-N-K . Please comment and confirm to avoid making useless changes. |
Yes. I think that is the case. I agree that if we should 'break' something, it should be rather in v1 than v2. But let me check in detail tomorrow.. EDIT: I confirm the above. |
That's a good reason I would prefer to have first a GO from @J-N-K before applying these breaking changes. |
For information, the only binding currently using different scopes is the max binding. |
Slighlty offtopic; i'm implementing some actions for the telegram binding and want to use an array as parameter. It's not working, might be something different. But the question is if i can find some documentation on allowed/supported parameters. The method with this signature does not show up in main UI (4.3.0M4) as other methods do. I don;t see a problem with the scope, the method name is unique
|
The type of your parameters chatIds and args are not supported by Main UI. The supported types are listed in this PR: String, boolean, Boolean, byte, Byte, short, Short, int, Integer, long, Long, float, Float, double, Double, Number, DecimalType, QuantityType<?>, LocalDateTime, LocalDate, LocalTime, ZonedDateTime, Date, Instant and Duration Ps how a variable list of java Object could be... |
I'm confused about the The documentation merely states @ThingActionsScope(name = "mqtt") // Your bindings id is usually the scope I'm lost - I can't get it to work. |
In fact we are all a little confused, it is still not so clear. I hoped we could discuss with @J-N-K but he does not answer. Regarding run of action from Main UI, it might be that you need to reload Main UI or maybe a bug in Main UI ? |
I've tried reloading many times, I've restarted, "cleaned" the project and everything I can think of to "clear caches", but the issue persists. MainUI does list the Actions though, so it might be a bug in MainUI. When running one of the actions from Rules DSL using `getActions(, ) it does work, which probably further hints that the problem is with MainUI. |
Pinging @florian-h05 as there is a potential issue in Main UI. |
I've tried with "." and ":" too - same result. |
I believe the problem is here in the REST API, we do not accept a "-" in the first part of the action id: |
I can't see any information about scope at all when running |
Try using bindingidxxx instead of bindingid-xxx just to confirm my hypothesis. |
actionid in the REST API is scope followed by a "." and followed by the method name like for example astro.getAzimut |
That works 👍 It's kind of "messy" to not have any separator at all though, so something should probably be changed. And the documentation must definitely explain how to use the scope much better. |
As you can see with this issue, this is something new and we have to fix it. So as soon as we are all sure that bindingid cannot be used for different action classes, we will have to fix the REST API also. |
I rather think that it is not allowed for a single ThingType to have multiple action classes in the same scope. A binding may habe multiple action class for different ThingTypes. |
@florian-h05 Correct. In fact the restriction is "one action class with the same scope per THING", not per |
Thanks for the feedback. |
That would also make using Thing actions from scripts very difficult, as the user would have to check which ThingActions implementation is returned. |
The use-case I can imagine is that a |
Thank you @J-N-K for clarification. If we want to allow bindingname-xxx as scope, we should update the REST API to allow the "-" character. Until that, actions from the max binding are certainly not runnable from REST API. |
It is not allowed to have several classes with the same thing action scope.
Here are the bindings not respecting this rule:
The text was updated successfully, but these errors were encountered: