Skip to content

Commit

Permalink
Fix homekit_controller pairing regression (#19654)
Browse files Browse the repository at this point in the history
* Fix homekit_controller pairing regression

* Use constant for pairing file name
  • Loading branch information
Jc2k authored and cgarwood committed Dec 30, 2018
1 parent 43eaa96 commit 855274e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions homeassistant/components/homekit_controller/__init__.py
Expand Up @@ -41,6 +41,8 @@
REQUEST_TIMEOUT = 5 # seconds
RETRY_INTERVAL = 60 # seconds

PAIRING_FILE = "pairing.json"


class HomeKitConnectionError(ConnectionError):
"""Raised when unable to connect to target device."""
Expand Down Expand Up @@ -150,7 +152,7 @@ def device_config_callback(self, callback_data):
pairing_file = os.path.join(
self.hass.config.path(),
HOMEKIT_DIR,
'pairing.json'
PAIRING_FILE,
)
self.controller.save_data(pairing_file)
_configurator = self.hass.data[DOMAIN+self.hkid]
Expand Down Expand Up @@ -248,7 +250,7 @@ def setup(hass, config):
if not os.path.isdir(data_dir):
os.mkdir(data_dir)

pairing_file = os.path.join(data_dir, 'pairings.json')
pairing_file = os.path.join(data_dir, PAIRING_FILE)
if os.path.exists(pairing_file):
controller.load_data(pairing_file)

Expand Down

0 comments on commit 855274e

Please sign in to comment.