mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Homekit controller BLE groundwork (part 2) (#20548)
* Only fetch values of characteristics we are tracking. * Use callbacks on subclasses to update individual values * Update alarm_control_panel to use update callbacks * Update climate to use update callbacks * Update cover to use update callbacks * Update light to use update callbacks * Update lock to use update callbacks * Update switch to use update callbacks * Remove compatibility code as all entities migrated * pylint by name rather than code
This commit is contained in:
@@ -61,18 +61,11 @@ class HomeKitLock(HomeKitEntity, LockDevice):
|
||||
CharacteristicsTypes.BATTERY_LEVEL,
|
||||
]
|
||||
|
||||
def update_characteristics(self, characteristics):
|
||||
"""Synchronise the Lock state with Home Assistant."""
|
||||
# pylint: disable=import-error
|
||||
from homekit.model.characteristics import CharacteristicsTypes
|
||||
def _update_lock_mechanism_current_state(self, value):
|
||||
self._state = CURRENT_STATE_MAP[value]
|
||||
|
||||
for characteristic in characteristics:
|
||||
ctype = characteristic['type']
|
||||
ctype = CharacteristicsTypes.get_short(ctype)
|
||||
if ctype == "lock-mechanism.current-state":
|
||||
self._state = CURRENT_STATE_MAP[characteristic['value']]
|
||||
elif ctype == "battery-level":
|
||||
self._battery_level = characteristic['value']
|
||||
def _update_battery_level(self, value):
|
||||
self._battery_level = value
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
||||
Reference in New Issue
Block a user