-
Notifications
You must be signed in to change notification settings - Fork 783
Basic UI: Player widget doesn't update automatically #2295
Comments
I can confirm the issue. I can see the events correctly being received by the Basic UI, so I assume this is something for @resetnow to fix. |
Note: This is completely unrelated to Sonos, it is not required to actually use any binding on the item/widget in order to reproduce it. |
I wasn't aware of existence of the Player widget. I assume next/previous buttons should also be non-selectable? |
REWIND and FASTFORWARD are both states - so if this item is in one of these states, the according button should appear selected. The other two states of the item are PLAY and PAUSE. |
Ok, I found the problem, for some reason event widget ID and the id assigned when a page is rendered are different. I can see a numeric widget id in the event but at the rendering time itemUIRegistry returns item name as ID here:
|
@kaikreuzer when a default widget is resolved to an actual widget type (resolveDefault in ItemUIRegistry.java), parent reference (eContainer) is lost. Should |
@michaeljoos72 as a temporary fix please consider using a Switch with an explicit mapping:
|
This might be a larger issue as I am seeing similar issues in BasicUI after #640 was merged. https://community.openhab.org/t/icons-no-longer-updating-in-basicui/15199/1 |
Is it something now resolved ?
and I can confirm that the item state is updated automatically in Basic UI when I play with it outside (with the Sonos application). |
@lolodomo are you using Internet Explorer or Edge by chance? |
@resetnow : no I am using Firefox on Windows. |
I just tested, it works for me in android chrome too. |
@lolodomo did you use Default sitemap item type? Because I don't think the problem with Default was solved |
@resetnow : here is how is defined my item:
and a snippet of my sitemap:
Sp yes I use default in sitemap. |
Just tested, it does not matter if the player is the first element of the frame or not. |
@resetnow: ok, I finally reproduced the issue, it only occurs when the player is on the main page. |
I am aware of your issue #2370 but how do you explain that it works when the default element is not in the main page ? Is this something that could help solving the problem for the main page ? |
If you already have your setup you can check if the player on the main page and subpage have different IDs (in HTML code) |
In the two cases, I see |
This probably means SSE events are different in two cases. |
For the sub-page, I can see the following HTML code:
The parent (div) has In the main page, the parent (div) has |
Ok, maybe something changed from the last time I looked into it, I'll check again. |
If I add a frame in the sub-page, it does not work anymore. So the problem seems to be the presence of a frame.
|
I have the feeling that "Default" add an intermediary frame with no widget id. Or maybe that is the "Player". I see no renderer class for the player, neither HTML snippet. Where is it ? |
Look up resolveDefault in ItemRegistryImpl |
The code that adds a frame around children is here: https://github.com/eclipse/smarthome/blob/master/extensions/ui/org.eclipse.smarthome.ui.basic/src/main/java/org/eclipse/smarthome/ui/basic/internal/render/PageRenderer.java#L107 |
I can confirm that the problem is the widget id in the SSE event which is correct only in one of the 3 described cases:
|
Events with numbers are actually correct and the one with item name isn't. Item name is used because when default widget is resolved to an actual widget, parent object reference (in EObject) is lost. |
Ok, so the case that is working is in fact due to a double error, one in the SSE event and one in UI. The widget id in sitemap event is ok when there is a frame probably due to this: https://github.com/eclipse/smarthome/blob/master/bundles/io/org.eclipse.smarthome.io.rest.sitemap/src/main/java/org/eclipse/smarthome/io/rest/sitemap/internal/PageChangeListener.java#L176 |
Do you know why this particular test on Frame is required in constructSitemapEvents ? Edit: I understand why now ;) "Frame" is the only case where you have to go one step deeper. |
This particular case with Frame in constructSitemapEvents explains why we have a correct ID in SSE event when the default element is inside a frame. In this case, the original widget is considered, not the "resolved" widget. |
@SJKA @kaikreuzer : please close this issue, the merged PR #3471 fixed it. |
Hi
In the new ESH builds automatic update of Sonos-Controller (Play, Pause) doesn't work anymore:
Player Sonos_Controller "Controller" (Sonos) {channel="sonos:PLAY1:living:control"}
sitemap demo label="Main Menu"
{
Frame label="Sonos" {
Default item=Sonos_Controller
}
}
To update the status a page reload is needed. Most probably it belongs to this issue:
https://github.com/eclipse/smarthome/issues/640
BR
Michael
The text was updated successfully, but these errors were encountered: