From 855274e354181669f9fe95bbceaf9c90e9fada23 Mon Sep 17 00:00:00 2001 From: Jc2k Date: Sun, 30 Dec 2018 19:44:26 +0000 Subject: [PATCH] Fix homekit_controller pairing regression (#19654) * Fix homekit_controller pairing regression * Use constant for pairing file name --- homeassistant/components/homekit_controller/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/homekit_controller/__init__.py b/homeassistant/components/homekit_controller/__init__.py index 689a8e9d91a..09068773e4e 100644 --- a/homeassistant/components/homekit_controller/__init__.py +++ b/homeassistant/components/homekit_controller/__init__.py @@ -41,6 +41,8 @@ _LOGGER = logging.getLogger(__name__) REQUEST_TIMEOUT = 5 # seconds RETRY_INTERVAL = 60 # seconds +PAIRING_FILE = "pairing.json" + class HomeKitConnectionError(ConnectionError): """Raised when unable to connect to target device.""" @@ -150,7 +152,7 @@ class HKDevice(): 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] @@ -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)