I’ve recently updated my installation from 5.1.1 to 5.1.2 and suddenly the list items with a simple custom list widget does not display anymore. The listwidget does show in the widgeteditor page. Does anyone have a clue where to start researching? I didn’t see anything in the release notes that hints me to the right direction….
The widget is a simple widget, that only changes icon and colors:
uid: light_list_widget
tags:
- light
- list
props:
parameters:
- description: The label for the widget
label: Title
name: title
required: false
type: TEXT
- context: item
description: The light switch Item
label: Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Aug 13, 2024, 8:43:41 AM
component: oh-toggle-item
config:
color: '=(@@props.item == "ON") ? "yellow" : "gray"'
icon: '=(@@props.item == "ON") ? "iconify:ph:lightbulb-duotone" :
"iconify:ph:lightbulb"'
iconColor: '=(@@props.item == "ON") ? "orange" : "gray"'
item: =props.item
title: =props.title
See this example in my “Equipment Tab" / “Light Bulbs”:
I’m using Edge and the Android App, neither of them shows the items. The browser console throws an error when I open the Lightbulb card (but this is abracadabra for me):
No worries, it’s not very meaningful for most and doesn’t really need to be. The good news is, it is enough to: 1) demonstrate that this is a bug, so an Issue should be filed (I can do that), and 2) suggest a work around until a bug-fix is applied.
All you need to do is add slots: {} to the end of your widget:
uid: light_list_widget
tags:
- light
- list
props:
parameters:
- description: The label for the widget
label: Title
name: title
required: false
type: TEXT
- context: item
description: The light switch Item
label: Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Aug 13, 2024, 8:43:41 AM
component: oh-toggle-item
config:
color: '=(@@props.item == "ON") ? "yellow" : "gray"'
icon: '=(@@props.item == "ON") ? "iconify:ph:lightbulb-duotone" :
"iconify:ph:lightbulb"'
iconColor: '=(@@props.item == "ON") ? "orange" : "gray"'
item: =props.item
title: =props.title
slots: {}
and your widgets should appear in the model cards again.
Jeez. You are a wizzard! I’ve done my fair share of debugging in the past, but I would have never found this one myself, just based on that error message.
Thanks Justin! I can confirm my widgets are visible again (and more important: the imminent divorce has been avoided )