I’m making progress here. I’ve create a first version of a custom widget using oh-list-card
as a container and oh-list-item
for the HVAC mode selection. To give feedback of the selected items I’ve used the icon f7:circle
for the non selected modes and f7:circle_fill
for the selected state.
First version looks like this:
uid: HVAC Mode Widget
props:
parameters:
- description: Der Titel der Betriebsart
label: Titel
name: title
required: true
type: TEXT
- context: item
description: Das Item für das die Betriebsart eingestellt wird
label: Betriebsart Item
name: item
required: true
type: TEXT
parameterGroups: []
timestamp: Jan 3, 2021, 2:51:27 PM
component: oh-list-card
config:
title: =props.title
slots:
default:
- component: oh-list-item
config:
title: Komfort
action: command
actionItem: =props.item
actionCommand: Comfort
icon: "=items[props.item].state === 'Comfort' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: Standby
action: command
actionItem: =props.item
actionCommand: Standby
icon: "=items[props.item].state === 'Standby' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: Nachtabsenkung
action: command
actionItem: =props.item
actionCommand: Economy
icon: "=items[props.item].state === 'Economy' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
- component: oh-list-item
config:
title: Frostschutz
action: command
actionItem: =props.item
actionCommand: Building Protection
icon: "=items[props.item].state === 'Building Protection' ? 'f7:circle_fill' : 'f7:circle'"
iconColor: red
The result looks like this:
Next step would be to give the list items the title as parameters. Question here, how to define a parameter with an array type.
Stay tuned