-
-
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
[Sitemap] Add widget similar to a remote control #3441
Comments
It is something relatively specific that will require a lot of work for a limited usage. For a TV remote control for example, other basic controls would be expected, like changing channel. |
It's also that there - unlike all other controls like player - isn't an item type which directly accepts the commands sent by the proposed control. |
I see. What about making it more generic by adding only the D-Pad? |
It would also be great if we could specify additional buttons around it so as not to waste the vertical space. On my LG remote, I have Home and back buttons on the left that I use a lot. These can be made configurable (or hidden). To the right could be volume up/down? |
I was thinking that this is one of the things missing from sitemaps, for the exact same reason (one way settable state like sending remote commands or maybe a traditional style numpad). However, could we consider something a little more generic like a "button grid" where you would have a grid of buttons. Then you could specify the icon or text for each button in a mappings property. If the mapping for a button number does not exist/empty, then that particular button in the grid is "hidden" (like the This should help make it more generic. Because I could see someone making a keypad or a more detailed remote set of buttons if they wanted to. We should let the user choose. Maybe if the label is empty, it is hidden from the UI so that only the buttongrid is shown. syntax idea for a directional pad like above
|
In general I like the idea of @Cossey. It gives a good amount of flexibility to the user. However I'd change two things:
I'd rather convert the button index to the value on the client, so the rule/binding is independent of the representation.
Using icons here is probably a good idea. Maybe we could use icons as label for I suggest a syntax like:
|
We can try to implement that in 4.1. |
Sounds awesome. Agreed that it should fit within the existing mappings; but hopefully still offer a little flexibility. Problem with switch when you have two or more mappings it is stateful. With a single mapping it shows as a stateless button. Maybe this could be extended with:
Even if this would be for buttons per a single line only, which still maintains backwards compatibility; if we have to use multiple switch lines for more rows that wouldn't be too bad and might be easier to keep consistent re layout. However with that approach, it might be nice to be able to forgo the spacing on the left for an icon and label when they are both set to an empty string, i know that probably makes it more work. |
I would like to check if there is still an interest amongst @openhab/android-maintainers and @openhab/ios-maintainers ? My proposal is to add a new sitemap element (Buttongrid) but keep a common syntax to define mappings for Switch/Selection/Buttongrid. Then we come back to the new Buttongrid element.
So the mappings define the buttons in the order left to right and top to bottom. The "cols" field defines how many buttons you should have on each line. WDYT ? |
Sounds good to me. I suggest to implement this as two features:
|
Yes, that was also my intention to separate in two features. And I will provide a PR in the core framework for the first one very soon (it is easy). Regarding the |
In basic UI, I could probably go further 4 by adding several buttons in the same cell but I will then have no control on the proper alignment. |
When set by the user, the icon can be used by UIs for switch element with mappings to render a button with the icon rather than the label. Related to openhab#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Depends on openhab/openhab-core#3809 Signed-off-by: Laurent Garnier <[email protected]>
The first step (using icon instead of label for buttons) is now implemented in core framework and in Basic UI. Not yet merged. |
Related to openhab/openhab-core#3441 Depends on openhab/openhab-core#3809 Icons will not be used if icons are nbot enabled (app setting). Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#3441 Signed-off-by: Laurent Garnier <[email protected]>
I created a PR to introduce the new |
@mueller-ma @maniac103 : I am asking myself a lot of questions about how we will render the buttongrid element in Basic UI and Android app.
To summarize, how do you imagine the rendering ? |
Maybe we should simply come back to @Cossey original idea to add a button index in the mappings. We could then name the field "buttons" rather than "mappings".
or even better
And maybe there is a control to add to check that the index is >=1 but has a max. Imagine a user enters 123456789 as index, this would create a BIG grid :) |
Not sure. Maybe we add a small limit (e.g. 5) now and see if it causes issues for users.
I'd make them fixed width: screen width / number of cols
I'd keep it similar to the current spacing between the buttons of a Roller Shutter item (up, down, stop). |
So that means potentially very large buttons (horizontally) if the user requests only one or two columns for example. |
Related to openhab#3441 Signed-off-by: Laurent Garnier <[email protected]>
PR for Buttongrid is now finished and ready for review. |
Related to #3441 Signed-off-by: Laurent Garnier <[email protected]>
@lolodomo Shall we hence close this issue here? |
Related to openhab/openhab-core#3441 Depends on openhab/openhab-core#3809 Icons will not be used if icons are not enabled (app setting). Signed-off-by: Laurent Garnier <[email protected]>
Yes probably and then create a change request in the repo of each UI. It was done in android repo already. One should be created in webui repo for Buttongrid in BasicUI. |
and one for expanding the sitemap editor in Main UI. |
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Playing with the Finally, I think we should replace the current index for each button by a couple line / column. In that case, we even do not need anymore the So for a grid 2x2 with one button at top left and one button a bottom right, instead of:
I propose:
@mueller-ma : WDYT ? |
@lolodomo Sounds good to me (at least). Some remarks:
|
Yes
No change here, yes.
Kill off I will try to submit the change this evening. |
@lolodomo Aren't you running into problems using comma both for separating the position in the grid and the buttons? |
In fact, it works but I agree with you that it is not ideal. I am going to replace the comma by a point : line.column: |
Arghhh ... does not work if I use "." or "_" or "x" as separator ! Works with 1:3:TEST="Test" |
Alternatives: 1x3 or 1|3 ... the former could probably be read as a size, though. |
On the sitemap builder, I have commas working, but I doubt it is ideal. |
I tried 1x3 but my syntax failed. 1 x 3 works. I don't understand. The interpret tries to interpret 1x3 ad a INT ! |
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Support grids containing from 1 to 12 columns. Only the first 8 columns are rendered on tablet. Only the first 4 columns are rendered on phone. Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Support grids containing from 1 to 12 columns. Only the first 8 columns are rendered on tablet. Only the first 4 columns are rendered on phone. Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
Support grids containing from 1 to 12 columns. Only the first 8 columns are rendered on tablet. Only the first 4 columns are rendered on phone. Related to openhab/openhab-core#3441 Signed-off-by: Laurent Garnier <[email protected]>
The new @openhab/android-maintainers @kaikreuzer : maybe you can close this issue ? |
Is your feature request related to a problem? Please describe.
I'd like to control my TV via Sitemap. For common functions, like opening an app, I can an extra widget (e.g. a Selection with a few pre-selected apps). But doing this for all functions is way to much work. Therefore I need buttons for up, down, left, right, ok and back.
Describe the solution you'd like
Add a new Sitemap widget (maybe called
RemoteControl
) that contains a dpad. While at it, other buttons can be added as well, but make the visibility of all buttons configurable.Example:
RemoteControl item=SomeStringItem showDpad=true showBack=true showHome=true showVolume=true showVoice=true
will result in something similar to the Android TV app: https://www.xda-developers.com/google-home-d-pad-controls-android-tv/Pressing a button will result a string to be send as command, e.g.
DPAD_UP
orVOLUME_MUTE
. Maybe also add a special item type, like it's done for Player.Describe alternatives you've considered
Additional context
Coordination between maintainers
I'd implement this in the Android app and docs.
Notify maintainers of other UIs:
@openhab/webui-maintainers
@openhab/android-maintainers
@openhab/ios-maintainers
Checklist for implementation:
The text was updated successfully, but these errors were encountered: