diff --git a/package.json b/package.json index e63f3dd..c4b1971 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "version": "1.0.0", "description": "A homebridge plugin for IntelliClima App from Fantini Cosmi.", "license": "Apache-2.0", + "author": "ruizmarc", "repository": { "type": "git", "url": "https://github.com/ruizmarc/homebridge-intelliclima.git" diff --git a/src/platform/IntelliClimaPlatform.ts b/src/platform/IntelliClimaPlatform.ts index fb22bc6..bf51bc3 100644 --- a/src/platform/IntelliClimaPlatform.ts +++ b/src/platform/IntelliClimaPlatform.ts @@ -2,6 +2,7 @@ import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, import { IntelliClimaAPIConsumer } from '../intelliclima/intelliclima-api-consumer'; import { ThermostatAccesory } from '../accessories/ThermostatAccessory'; +import { PLUGIN_NAME } from '../settings'; /** * HomebridgePlatform @@ -23,6 +24,12 @@ export class IntelliClimaPlatform implements DynamicPlatformPlugin { ) { this.log.debug('Finished initializing platform:', this.config.name); + // only load if configured + if (!this.config.username || !this.config.password) { + log.warn(`No configuration found for ${PLUGIN_NAME}`); + return; + } + // When this event is fired it means Homebridge has restored all cached accessories from disk. // Dynamic Platform plugins should only register new accessories after this event was fired, // in order to ensure they weren't added to homebridge already. This event can also be used