-
-
Notifications
You must be signed in to change notification settings - Fork 92
[enhancement] Selection Widget, additional source for comma-separated list of choices #285
Comments
Sounds reasonable! |
Ideally, yes. Updating the choices on the fly would reflect updates (add/change/delete) made to the Favorites on the music player. Let's say the music player Thing has a channel for the favorites choices, and that channel is linked to the FavoriteChoices item. Also, the music player Thing updates the favorites choices periodically (like every minute or so). When the channel receives an update, the choices in the Selection Widget would reflect the most current state of the favorites on the player. Given such an update frequency, it would be very unlikely that the choices in HABpanel would be out of sync with the music player. Edit: Reference my post on the forum here |
A couple other questions on this, :-) In the comma-separated list of choices, is there a reason you also don't allow the RHS to be wrapped in single and/or double quotes? For example:
Without the quoting, is there a way to escape a comma embedded in the choice? |
@ghys In the above reference, we're discussing how to dynamically update the state options at runtime to hold the favorites list. This approach likely will work for SqeezeeBox and Sonos. As it uses HABpanel's existing Selection widget functionality (server-provided item options), the above functionality may not be needed. However, my one question at this point is whether HABpanel detects that the item's state options have changed at runtime, and automatically updates those options in the Selection widget. |
Looks good @mhilbush! Feel free to update this issue as the discussions on the ESH side evolve.
No it doesn't, because of this check it will only retrieve and populate the choices the first time:
We can safely remove that check and update the list of options every time the modal window is displayed.
No reason, I didn't expect choices to include a comma honestly :) The implementation is pretty simplistic:
|
The Selection Widget currently has two sources for the choices:
I'd like to propose another alternative for supplying the comma-separated list of choices.
Let's say I have two Items:
The FavoritePlay Item is linked to a channel on the music player Thing that's used to tell the music player to play a Favorite from it's internal list of Favorites. FavoritePlay would populate the openHAB Item in the Selection Widget settings.
The FavoriteChoices Item is linked to another channel on the music player Thing that populates a comma-separated list of Favorites from the music player's internal list of Favorites, like this:
It would nice if I could specify FavoriteChoices as a source for the comma-separated list of choices. Then, once a selection is made from the list of choices, the value (e.g. 35caffa2.1) can be used to play that Favorite on the music server using the FavoritePlay Item.
So, basically, instead of specifying the comma-separated list as you do here, I'd like to provide an Item from which the comma-separated list can be sourced.
Edit: I should add that this would make it much easier to maintain the list of choices in HABpanel as Favorites are added/changed/removed on the music player (i.e. there would be no maintenance required at all)
The text was updated successfully, but these errors were encountered: