Skip to content

Commit

Permalink
Fix isActive for locks (home-assistant#3862)
Browse files Browse the repository at this point in the history
* Fix isActive for locks

Lock entity should be active when locked, inactive otherwise

* Added a comment to explain the change
  • Loading branch information
aronsky authored Sep 19, 2023
1 parent 03e3cee commit a31cd2f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,8 @@ fun <T> Entity<T>.isActive() = when {
(domain == "cover") -> state != "closed"
(domain in listOf("device_tracker", "person")) -> state != "not_home"
(domain == "lawn_mower") -> state in listOf("mowing", "error")
(domain == "lock") -> state != "locked"
// on Android, contrary to HA Frontend, a lock is considered active when locked
(domain == "lock") -> state == "locked"
(domain == "media_player") -> state != "standby"
(domain == "vacuum") -> state !in listOf("idle", "docked", "paused")
(domain == "plant") -> state == "problem"
Expand Down

0 comments on commit a31cd2f

Please sign in to comment.