Better handling of HomeKit accessory-information service (#22171)
* HomeKit controller: Better handling of accessory-information service * Changes from review
This commit is contained in:
parent
6cb8806085
commit
0344c761fc
3 changed files with 10 additions and 20 deletions
|
@ -74,21 +74,14 @@ class HomeKitGarageDoorCover(HomeKitEntity, CoverDevice):
|
|||
CharacteristicsTypes.DOOR_STATE_CURRENT,
|
||||
CharacteristicsTypes.DOOR_STATE_TARGET,
|
||||
CharacteristicsTypes.OBSTRUCTION_DETECTED,
|
||||
CharacteristicsTypes.NAME,
|
||||
]
|
||||
|
||||
def _setup_name(self, char):
|
||||
self._name = char['value']
|
||||
|
||||
def _update_door_state_current(self, value):
|
||||
self._state = CURRENT_GARAGE_STATE_MAP[value]
|
||||
|
||||
def _update_obstruction_detected(self, value):
|
||||
self._obstruction_detected = value
|
||||
|
||||
def _update_name(self, value):
|
||||
self._name = value
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if entity is available."""
|
||||
|
@ -172,12 +165,8 @@ class HomeKitWindowCover(HomeKitEntity, CoverDevice):
|
|||
CharacteristicsTypes.HORIZONTAL_TILT_CURRENT,
|
||||
CharacteristicsTypes.HORIZONTAL_TILT_TARGET,
|
||||
CharacteristicsTypes.OBSTRUCTION_DETECTED,
|
||||
CharacteristicsTypes.NAME,
|
||||
]
|
||||
|
||||
def _setup_name(self, char):
|
||||
self._name = char['value']
|
||||
|
||||
def _update_position_state(self, value):
|
||||
self._state = CURRENT_WINDOW_STATE_MAP[value]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue