Hi,
i’ve tried to develop a new widget for my photovoltaic installation. I want to sum up the actual power of all strings. I saw that is possible to create a widget property with multiple: true, so i tried to define the property this way and sum up all the selected items in the widget with .map, but it will not work.
Is that possible?
Here is my try to get access to all items through map:
uid: Test
tags: []
props:
parameters:
- context: item
label: Current Power
name: power_item
required: false
type: TEXT
multiple: true
parameterGroups: []
timestamp: Jul 12, 2022, 7:31:19 AM
component: f7-card
config:
style:
background-color: white
border-radius: var(--f7-card-expandable-border-radius)
box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.1)
height: 120px
margin-left: 5px
margin-right: 5px
noShadow: false
padding: 0px
slots:
content:
- component: f7-block
config:
style:
bottom: -40px
display: flex
flex-direction: row
left: 12px
position: absolute
slots:
default:
- component: f7-icon
config:
f7: drop
size: 18
visible: "=props.power_item ? true : false"
- component: Label
config:
style:
font-size: 12px
margin-left: 5px
margin-top: 0px
text: "=Arrays.stream(props.power_item.map[x | items[x]]).sum()"
visible: "=props.power_item ? true : false"
I don’t want to create multiple properties and sum them up, because that would not be dynamic enough.