Add open state to LockEntity (#111968)

* Add `open` state to LockEntity

* Add tests

* Fixes

* Fix tests

* strings and icons

* Adjust demo open lock

* Fix lock and tests

* fix import

* Fix strings

* mute ruff

* Change sequence

* Sequence2

* Group on states

* Fix ruff

* Fix tests

* Add more test cases

* Sorting
This commit is contained in:
G Johansson 2024-05-08 20:42:22 +02:00 committed by GitHub
parent 189c07d502
commit 7862596ef3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 377 additions and 37 deletions

View file

@ -2,7 +2,14 @@
from typing import TYPE_CHECKING
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
from homeassistant.const import (
STATE_LOCKED,
STATE_LOCKING,
STATE_OPEN,
STATE_OPENING,
STATE_UNLOCKED,
STATE_UNLOCKING,
)
from homeassistant.core import HomeAssistant, callback
from .const import DOMAIN
@ -16,4 +23,15 @@ def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
) -> None:
"""Describe group on off states."""
registry.on_off_states(DOMAIN, {STATE_UNLOCKED}, STATE_UNLOCKED, STATE_LOCKED)
registry.on_off_states(
DOMAIN,
{
STATE_LOCKING,
STATE_OPEN,
STATE_OPENING,
STATE_UNLOCKED,
STATE_UNLOCKING,
},
STATE_UNLOCKED,
STATE_LOCKED,
)