Bump homekit==0.12.2 + improve controller reliability (#20325)
Sessions were timing out and requiring a HA restart in order to restore functionality. Network disconnects are now handled and sessions will be automatically recovered after they fail.
This commit is contained in:
parent
7ca7951526
commit
a396ee2cb5
2 changed files with 8 additions and 8 deletions
|
@ -13,7 +13,7 @@ from homeassistant.helpers import discovery
|
|||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.event import call_later
|
||||
|
||||
REQUIREMENTS = ['homekit==0.12.0']
|
||||
REQUIREMENTS = ['homekit==0.12.2']
|
||||
|
||||
DOMAIN = 'homekit_controller'
|
||||
HOMEKIT_DIR = '.homekit'
|
||||
|
@ -49,10 +49,6 @@ RETRY_INTERVAL = 60 # seconds
|
|||
PAIRING_FILE = "pairing.json"
|
||||
|
||||
|
||||
class HomeKitConnectionError(ConnectionError):
|
||||
"""Raised when unable to connect to target device."""
|
||||
|
||||
|
||||
def get_serial(accessory):
|
||||
"""Obtain the serial number of a HomeKit device."""
|
||||
# pylint: disable=import-error
|
||||
|
@ -101,13 +97,14 @@ class HKDevice():
|
|||
"""Handle setup of a HomeKit accessory."""
|
||||
# pylint: disable=import-error
|
||||
from homekit.model.services import ServicesTypes
|
||||
from homekit.exceptions import AccessoryDisconnectedError
|
||||
|
||||
self.pairing.pairing_data['AccessoryIP'] = self.host
|
||||
self.pairing.pairing_data['AccessoryPort'] = self.port
|
||||
|
||||
try:
|
||||
data = self.pairing.list_accessories_and_characteristics()
|
||||
except HomeKitConnectionError:
|
||||
except AccessoryDisconnectedError:
|
||||
call_later(
|
||||
self.hass, RETRY_INTERVAL, lambda _: self.accessory_setup())
|
||||
return
|
||||
|
@ -199,10 +196,13 @@ class HomeKitEntity(Entity):
|
|||
|
||||
def update(self):
|
||||
"""Obtain a HomeKit device's state."""
|
||||
# pylint: disable=import-error
|
||||
from homekit.exceptions import AccessoryDisconnectedError
|
||||
|
||||
try:
|
||||
pairing = self._accessory.pairing
|
||||
data = pairing.list_accessories_and_characteristics()
|
||||
except HomeKitConnectionError:
|
||||
except AccessoryDisconnectedError:
|
||||
return
|
||||
for accessory in data:
|
||||
if accessory['aid'] != self._aid:
|
||||
|
|
|
@ -526,7 +526,7 @@ home-assistant-frontend==20190121.1
|
|||
homeassistant-pyozw==0.1.2
|
||||
|
||||
# homeassistant.components.homekit_controller
|
||||
# homekit==0.12.0
|
||||
# homekit==0.12.2
|
||||
|
||||
# homeassistant.components.homematicip_cloud
|
||||
homematicip==0.10.3
|
||||
|
|
Loading…
Add table
Reference in a new issue