helpers.localize for brightness, does not return the actual brightness in %
Checklist
- [yes ] I updated the card to the latest version available
- [ y] I cleared the cache of my browser
Describe the bug
when using "[[[ return helpers.localize(states[entity], states[entity].attributes?.brightness); ]]]" it just returns the value of the brightness attribute ie 8, I would of expected it to return the actual brightness with the measurement type. ie 3%, to get the required result atm I have to use.
label: >
[[
let bri = Math.round(helpers.localize(states[entity], states[entity].attributes?.brightness) / 2.55);
return (bri ? bri : "0") + "%";
]]
Version of the card Version: 4.1.1
To Reproduce This is the configuration I used:
label = "[[[ return helpers.localize(states[entity], states[entity].attributes?.brightness); ]]]"
Expected behavior
I would of expected it to return the actual brightness with the measurement type. ie 3%
It doesn't work like that unfortunately, that works only for "text" attributes or numeric main state of an entity. helpers.localize has no effect here, you should directly access the brightness attribute.
the issue is the attribute does not hold the % value, but OK i'll keep using Math