Update homekit controller to homekit==0.12.0 (#19549)

This commit is contained in:
Jc2k 2018-12-24 21:13:17 +00:00 committed by Martin Hjelmare
parent a8797a08c6
commit e0f50a9e54
5 changed files with 83 additions and 104 deletions

View file

@ -35,11 +35,12 @@ class HomeKitSwitch(HomeKitEntity, SwitchDevice):
def update_characteristics(self, characteristics):
"""Synchronise the switch state with Home Assistant."""
import homekit # pylint: disable=import-error
# pylint: disable=import-error
from homekit.model.characteristics import CharacteristicsTypes
for characteristic in characteristics:
ctype = characteristic['type']
ctype = homekit.CharacteristicsTypes.get_short(ctype)
ctype = CharacteristicsTypes.get_short(ctype)
if ctype == "on":
self._chars['on'] = characteristic['iid']
self._on = characteristic['value']