mirror of
https://github.com/home-assistant/android
synced 2024-10-15 12:32:54 +00:00
Fix isActive for locks (#3862)
* Fix isActive for locks Lock entity should be active when locked, inactive otherwise * Added a comment to explain the change
This commit is contained in:
parent
03e3cee8e3
commit
a31cd2fdaa
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue