I’ve created a custom widget base on the OH3 examples.
The issue I’m having is the icon color is not changing with an update to the item state. As you can see in the image below, i toggled off the “Living Downlight 1 OnOff” item, but the icon stays green.
Widget YAML:
uid: all_lights
tags:
- card
- lights
props:
parameters:
- description: A text prop
label: Prop 1
name: prop1
required: false
type: TEXT
- context: item
description: An item to control
label: Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Aug 4, 2021, 1:57:51 PM
component: f7-card
config:
title: All Lights
slots:
default:
- component: oh-list
slots:
default:
- component: oh-repeater
config:
fragement: true
for: item
sourceType: itemsWithTags
itemTags: Switch,Light
filter: loop.item.label.includes("Christmas") == false || items.TisTheSeason.state == "ON"
slots:
default:
- component: oh-toggle-item
config:
icon: f7:lightbulb
iconColor: '=(loop.item.state == "ON") ? "green" : "gray"'
color: '=(loop.item.state == "ON") ? "green" : "gray"'
title: =loop.item.label
item: =loop.item.name
Image after toggle: