This shows that the Label of an item does not include it’s parent device name.
Now I wish to list all the power switches of my Shelly devices in a Custom Widget. When I use oh-repeater and list all items by loop.item.label I get a list with just “Switch” and not the actual device name.
I’m trying to find a list of all available properties you can use in a Custom Widget but I’m unable to find it. Could I for instance get the thing device name?
My second question is, how can I order the oh-repeater output by its title?
The label property is the Human readable label that an item has been given. The name property is the unique identifying name for that item.
In this case, the oh-repeater is just making a call to the items API to get the items. It returns the complete JSON object that is the API response. So, if you want to see what the repeater is giving you, then you can just use the API explorer to pull up an example of an item and look at that.
This is actually not trivial. There is no built-in sort property for an oh-repeater. You can brute force a sort order by using the map property, creating a custom sort function, and returning the correct element of the newly ordered array with the internal _idx variable. This, however, if it is a long list, can have a noticeable performance impact as the sort isn’t preformed just once but for each element the repeater returns.