Winging this python stuff
I have
BATTERY_LIST_NEW = ['Dryer Door Battery Level:--', 'Dimmer Switch Battery Level:690 day(s)']
and i can do this
hass.states.set(sensorName , 'on' ,
{
"friendly_name" : "{} {}".format("Battery","States") ,
"Dryer Door Battery Level": "--",
"Dimmer Switch Battery Level" : "690 day(s)",
"icon" : "mdi:calendar-star"
}
)
I get
HAPPY CAMPER
NOW so want to add the BATTERY_LIST_NEW to the sensor
hass.states.set(sensorName , 'on' ,
{
"friendly_name" : "{} {}".format("Battery","States") ,
for battery in BATTERY_LIST_NEW:
aa = battery.split(":")
# what do put here I know aa[0] = battery name and aa[1] = has the day count
# just dont know how to write it here.
"icon" : "mdi:calendar-star"
}
)
have i mis the bus on this