homebridge-flair
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -15,5 +15,6 @@ import type { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig } from 'homebridge'; | ||
readonly accessories: PlatformAccessory[]; | ||
private client; | ||
private client?; | ||
private structure?; | ||
private rooms; | ||
private hasValidConfig; | ||
constructor(log: Logger, config: PlatformConfig, api: API); | ||
@@ -20,0 +21,0 @@ private validConfig; |
@@ -26,5 +26,8 @@ "use strict"; | ||
this.rooms = []; | ||
this.hasValidConfig = false; | ||
this.log.debug('Finished initializing platform:', this.config.name); | ||
if (!this.validConfig()) { | ||
throw ('The Flair config is no valid.'); | ||
this.hasValidConfig = this.validConfig(); | ||
if (!this.hasValidConfig) { | ||
this.log.error('The Flair config is not valid, please ensure your config has all necessary settings.'); | ||
return; | ||
} | ||
@@ -37,2 +40,5 @@ this.client = new flair_api_ts_1.Client(this.config.clientId, this.config.clientSecret, this.config.username, this.config.password); | ||
this.api.on("didFinishLaunching" /* DID_FINISH_LAUNCHING */, async () => { | ||
if (!this.hasValidConfig) { | ||
return; | ||
} | ||
log.debug('Executed didFinishLaunching callback'); | ||
@@ -108,2 +114,5 @@ // run the method to discover / register your devices as accessories | ||
configureAccessory(accessory) { | ||
if (!this.hasValidConfig) { | ||
return; | ||
} | ||
this.log.info('Restoring accessory from cache:', accessory.displayName); | ||
@@ -110,0 +119,0 @@ if (accessory.context.type === flair_api_ts_1.Puck.type) { |
{ | ||
"displayName": "Homebridge Flair", | ||
"name": "homebridge-flair", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npmjs.org/" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
81607
869