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

This commit is contained in:
Jc2k authored and Martin Hjelmare committed 2018-12-24 22:13:17 +01:00
1 parent a8797a08c6
commit e0f50a9e54
5 files changed
+83 -104

No files matched your search

@@ -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']