ajnart / homarr

Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)
https://homarr.dev
MIT License
5.48k stars 253 forks source link

Home Assistant entity generic toggle #2015

Closed tuggan closed 1 month ago

tuggan commented 2 months ago

Added support for generic toggle on Home Assistant entities that support it. For entities that does not support toggle the feature will silently fail. This way matches how Home Assistant handles it.

Category

Feature

Overview

Currently when enabling both toggle and automation both will run on click. I am not sure what the best way of handling this is so that it is intuitive for the user. Personally i do not mind if it runs both when you have configured both but I'd love input on this.

Issue Number

1848

New Vars

Entity toggle switch on the home assistant entity card.

manuel-rw commented 2 months ago

I'm currently unable to review this because I'm in holidays. I will be back on the 22 April but may not review this until a few days later. Please remind me to review this PR.

manuel-rw commented 2 months ago

This is really cool. I'm looking forward for this change for my private instance!

tuggan commented 2 months ago

Ah yes, I'll go through that logic again and try to see what i was thinking

tuggan commented 1 month ago

The first if statement was redundant I just didn't remove it at first because i didn't want to change too much and then probably forgot it. The other two are needed to only execute the configured actions