DBuit / Homekit-panel-card

Homekit panel card for home assistant
MIT License
304 stars 54 forks source link

[Feature Request] Option to round /multiply attribute values for state/statePath #96

Open kaosmagix opened 3 years ago

kaosmagix commented 3 years ago

This card is great and made it very easy to create a nice usable mobile UI.

I would like to add the Volume level of a media player as the additional state shown (top right circle) using the state and statePath setting. This works but it shows the value unrounded and with all digits. The volume_level ranges between 0-1 and I would like to show it in the circle as a percentage (so 40% and not 0.400000000000023) and if possible also showing the circle fill like brightness does for example. Is it possible to add functionality to add settings for rounding of the attribute, and the option to show it in the circle like for example Brightness does? This last part might be related to the value between 0 and 1 instead of 1 - 100 like Brightness

# lovelace_gen
entity: {{ media_player_entity }}
state: {{ media_player_entity }}
statePath: attributes.volume_level