thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

FR: Toogle for state rows #73

Closed loeffelpan closed 2 years ago

loeffelpan commented 2 years ago

I have a attribute of an entity I would like torender as a toggle. For now I use this, but toggle: true seem to work just for an entity not for a state: template. Maybe you can add this for template rendering to true/false or on/off. Would avoid a couple of binary_sensors for me.

image

thomasloven commented 2 years ago

That's a hard no. A toggle is clickable and should do something when you click it.

loeffelpan commented 2 years ago

Accepted. But if entity is e.g. a binary-sensor toggle would work, too. And toggle is a wonderful way to just show binary states.

ildar170975 commented 2 years ago

binary-sensor

What do you expect when toggling a binary_sensor entity? It's state is set either by its integration or by some template (if it is a template sensor), it cannot be just toggled manually.

loeffelpan commented 2 years ago

Sorry for being unclear. Nothing would happen when toggling a binary_sensor. But the option toggle: true can render it and shows the state in a beautiful way. It can render any entity with binary states, unless toggling them make sense or not. So my intention was "why not rendering the state: as toggle?" just for showing the state. In the end I probably would use restriction-card to protect those toggles from useless toggling.

thomasloven commented 2 years ago

I see your point, but I believe firmly in the Principle of Least Astonishment, and a toggle that doesn't do anything does not fall under that.

https://www.home-assistant.io/integrations/switch.template/

loeffelpan commented 2 years ago

I'm fine with your decision. Thanks. To be consequent binary sensors shouldn't be redendered as toggle, but maybe it is not easy to avoid.