mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 11:18:00 +02:00
Fix unavailable state for homekit locks and covers (#22390)
This commit is contained in:
@@ -82,11 +82,6 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverDevice):
|
|||||||
def _update_obstruction_detected(self, value):
|
def _update_obstruction_detected(self, value):
|
||||||
self._obstruction_detected = value
|
self._obstruction_detected = value
|
||||||
|
|
||||||
@property
|
|
||||||
def available(self):
|
|
||||||
"""Return True if entity is available."""
|
|
||||||
return self._state is not None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
@@ -146,11 +141,6 @@ class HomeKitWindowCover(HomeKitEntity, CoverDevice):
|
|||||||
self._obstruction_detected = None
|
self._obstruction_detected = None
|
||||||
self.lock_state = None
|
self.lock_state = None
|
||||||
|
|
||||||
@property
|
|
||||||
def available(self):
|
|
||||||
"""Return True if entity is available."""
|
|
||||||
return self._state is not None
|
|
||||||
|
|
||||||
def get_characteristic_types(self):
|
def get_characteristic_types(self):
|
||||||
"""Define the homekit characteristics the entity cares about."""
|
"""Define the homekit characteristics the entity cares about."""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
|
@@ -64,11 +64,6 @@ class HomeKitLock(HomeKitEntity, LockDevice):
|
|||||||
"""Return true if device is locked."""
|
"""Return true if device is locked."""
|
||||||
return self._state == STATE_LOCKED
|
return self._state == STATE_LOCKED
|
||||||
|
|
||||||
@property
|
|
||||||
def available(self):
|
|
||||||
"""Return True if entity is available."""
|
|
||||||
return self._state is not None
|
|
||||||
|
|
||||||
async def async_lock(self, **kwargs):
|
async def async_lock(self, **kwargs):
|
||||||
"""Lock the device."""
|
"""Lock the device."""
|
||||||
await self._set_lock_state(STATE_LOCKED)
|
await self._set_lock_state(STATE_LOCKED)
|
||||||
|
Reference in New Issue
Block a user