yeah sure, i’ve only just started to mess about with widgets so it might not be correct but it looks to work ok, i have one for dimmers and switches created. Looking to create a thermostat one next
uid: JS_Dimmer
props:
parameters:
- label: Device Name
name: device
required: true
type: TEXT
- context: item
description: An item to control
label: Item
name: item
required: true
type: TEXT
timestamp: Feb 8, 2021, 7:16:13 PM
component: f7-card
config:
style:
height: 250px
width: 250px
background: '=(items[props.item].state >= "1") ? "linear-gradient(30deg, #20202e, #373749)" : "linear-gradient(30deg, #2a2a38, #4d4d64)"'
border-radius: 25% 10%
color: 255,255,255
box-shadow: white
slots:
default:
- component: f7-icon
config:
f7: lightbulb
color: white
size: 30
style:
position: absolute
--my-opacity: '=(items[props.item].state == "0") ? "10%" : (items[props.item].state) +"%"'
left: 30px
top: 30px
filter: opacity(var(--my-opacity))
- component: Label
config:
text: =props.device
style:
position: absolute
left: 30px
top: 70px
color: white
font-size: 22px
font-weight: 600
line-height: 32px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
filter: opacity(80%)
- component: oh-slider
config:
item: =props.item
label: true
min: 0
max: 100
step: 10
scale: true
style:
position: absolute
top: 121px
left: 30px
width: 200px
--f7-range-knob-size: 20px
--f7-range-knob-color: rgb(137, 117, 243)
--f7-range-bar-size: 15px
--f7-range-bar-border-radius: 10px
--f7-range-bar-bg-color: rgb(29, 30, 40)
--f7-range-bar-active-bg-color: rgb(13, 13, 13)
--f7-range-label-size: 20px
--f7-range-label-text-color: white
--f7-range-label-bg-color: rgb(29, 30, 40)
--f7-range-scale-step-color: white
- component: Label
config:
text: '=(items[props.item].state >= "1") ? "On" : "Off"'
style:
position: absolute
left: 150px
top: 175px
color: white
font-size: 20px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
- component: oh-toggle
config:
item: =props.item
style:
position: absolute
top: 179px
left: 30px
--f7-toggle-handle-color: rgb(137, 117, 243)
--f7-toggle-inactive-color: rgb(29, 30, 40)
--f7-toggle-active-color: rgb(13, 13, 13)
--f7-toggle-width: 50px
--f7-toggle-height: 25px
uid: JS_Switch
props:
parameters:
- label: Device Name
name: device
required: true
type: TEXT
- context: item
description: An item to control
label: Item
name: item
required: true
type: TEXT
timestamp: Feb 8, 2021, 7:18:59 PM
component: f7-card
config:
style:
height: 250px
width: 250px
background: '=(items[props.item].state >= "1") ? "linear-gradient(30deg, #20202e, #373749)" : "linear-gradient(30deg, #2a2a38, #4d4d64)"'
border-radius: 25% 10%
color: 255,255,255
box-shadow: white
slots:
default:
- component: f7-icon
config:
f7: lightbulb
color: white
size: 30
style:
position: absolute
left: 30px
top: 30px
filter: opacity(80%)
- component: Label
config:
text: =props.device
style:
position: absolute
left: 30px
top: 70px
color: white
font-size: 22px
font-weight: 600
line-height: 32px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
filter: opacity(80%)
- component: Label
config:
text: '=(items[props.item].state >= "1") ? "On" : "Off"'
style:
position: absolute
left: 150px
top: 175px
color: white
font-size: 20px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
- component: oh-toggle
config:
item: =props.item
style:
position: absolute
top: 179px
left: 30px
--f7-toggle-handle-color: rgb(137, 117, 243)
--f7-toggle-inactive-color: rgb(29, 30, 40)
--f7-toggle-active-color: rgb(13, 13, 13)
--f7-toggle-width: 50px
--f7-toggle-height: 25px