-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
[thing-details] Extend special handling of "actions" parameter group to all bindings #1491
Comments
Hi @mbronk, |
For Main UI's Thing-Details view. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronkm+gh@gmail.com> Signed-off-by: mbronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
Hi @ghys, FYI - I do not have a fully-functional Z-Wave setup at this time, so I guess it wouldn't hurt if someone who does, also took a 2nd look as well... Full disclosure: I actually don't even have a full on node/vue dev env, and the changes seemed small enough not to invest in setting everything up. Alas, I have not run full set of automated tests (taking a leap of faith and trusting the CI here, as far as I've seen this should be transparent to them though), and made only a rudimentary smoke test proving that the buttons do seem to work on my setup... Sorry if this seems half-baked. I won't be able to allocate more time to it in near future and figured it is worth submitting as-is. If the PR creates more chaos than it helps - feel free to reject right off the bat. Cheers! |
For Main UI's Thing-Details view. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Fixes openhab#1491 Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com>
For Main UI's Thing-Details view. Matching is by group param context ("actions") first, then falls back to "by name" for Z-Wave binding backwards-compatibility. Closes #1491. Signed-off-by: Mateusz Bronk <bronk.m+gh@gmail.com> Also-by: Yannick Schaus <github@schaus.net>
The problem
Currently, the Thing Details view handles Z-Wave binding special, and presents a list of actions (
<parameter-group name="actions">
) as clickable buttons, with confirmation prompt.This behavior is nice and desirable, but specific to Z-Wave binding only:
openhab-webui/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue
Lines 374 to 378 in 60fd5f3
openhab-webui/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue
Lines 110 to 119 in 60fd5f3
Your suggestion
Make the abovementioned behavior more generic (remove hard-code for Z-Wave, allow other bindings to use it).
Exemplary proposal
Use the "action" behavior IFF the following heuristic match is true:
groupName == 'actions' && groupLabel === 'Actions' && groupDescription === 'Actions' && action.type === 'BOOLEAN'
^--- The values have been picked to be backwards-compatible with existing Zwave binding's implementation. Assumption is these values would never be i18n'ed and we want to avoid extra conditions.
Note: A bigger (more semantically correct) change may include changing the Configuration Description DSL to include a new parameter group and/or type (say:
action
) and remove the heuristic matching by group/param name. This would be a OH-core change, though and given this Z-Wave hardcode has been around for ~3y now, seems to be an overkill to introduce now IMHO.Rationale
It is customary for some devices to include a "reset to factory default" functionality. Z-Wave binding's paradigm of showing such one-off "commands" as actions seems appropriate and would create consistent UX.
Your environment
Additional information
Disclaimer: I'm currently developing a binding which would benefit from this functionality.
The text was updated successfully, but these errors were encountered: