Alright, I’ve almost got the core of a “knockoff” location-card working, but and while I’m able to pass the expressions into the component line, I still can’t get the widget config into the configuration on a generalized basis. Any suggestions? Is doing so even possible?
uid: knockoff-location-card
tags: []
props:
parameters:
- context: item
description: An item to control
label: Item
name: item
required: false
type: TEXT
parameterGroups: []
timestamp: Dec 21, 2022, 6:30:31 PM
component: f7-card
config:
title: =props.item
slots:
default:
- component: oh-list
slots:
default:
- component: oh-repeater
config:
fetchMetadata: listWidget
for: item
groupItem: =props.item
filter: (['AlarmSystem','BackDoor','Battery','Blinds','Boiler','Camera','Car','CeilingFan','CellarDoor','CleaningRobot','Dishwasher','Door','Doorbell','Dryer','Equipment','Fan','Freezer','FrontDoor','GarageDoor','Gate','HVAC','InnerDoor','Inverter','KitchenHood','LawnMower','Lightbulb','LightStripe','Lock','MotionDetector','NetworkAppliance','Oven','PowerOutlet','Projector','Pump','RadiatorControl','Receiver','Refrigerator','RemoteControl','Screen','Sensor','SideDoor','Siren','Smartphone','SmokeDetector','Speaker','Television','Valve','VoiceAssistant','WallSwitch','WashingMachine','WeatherService','WebService','WhiteGood','Window'].indexOf(loop.item.tags[0]) > -1 )
sourceType: itemsInGroup
slots:
default:
- component: Label
config:
text: =loop.item.label
- component: oh-repeater
config:
fetchMetadata: listWidget
for: element
groupItem: =loop.item.name
sourceType: itemsInGroup
filter: (loop.element.tags.length >= 1)
slots:
default:
- component: =loop.element.metadata.listWidget.value
config: =loop.element.metadata.listWidget.config
- component: Label
config:
text: =loop.element.metadata.listWidget.config
The issue is that =loop.element.metadata.listWidget.config
evaluates properly to eg. { "title": "Main", "root_item": "GuestBedroom_Lights_Main1" }
or { "title": "Yard" }
, this is somehow not properly formatted or skipped by the interpreter
Pretty close (except for the styling):