diff --git a/config.schema.json b/config.schema.json index 17a0ffb..0a18617 100644 --- a/config.schema.json +++ b/config.schema.json @@ -32,7 +32,7 @@ }, "longitude": { "title": "Longitude", - "type": "string", + "type": "number", "required": true }, "hueLights": { diff --git a/package-lock.json b/package-lock.json index c8a35a0..15a1b37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@types/node-cron": "^2.0.3", "@types/suncalc": "^1.8.0", - "@watsonb8/wiz-lib": "^1.0.1-62427.0", + "@watsonb8/wiz-lib": "^1.0.1-e1c84.0", "node-cron": "^2.0.3", "node-hue-api": "^4.0.5", "suncalc": "^1.8.0" @@ -119,9 +119,9 @@ "integrity": "sha512-XLD/llTSB6EBe3thkN+/I0L+yCTB6sjrcVovQdx2Cnl6N6bTzHmwe/J8mWnsXFgxLrj/emzdv8IR4evKYG2qxQ==" }, "node_modules/@watsonb8/wiz-lib": { - "version": "1.0.1-18e79.0", - "resolved": "http://10.44.1.6:4873/@watsonb8%2fwiz-lib/-/wiz-lib-1.0.1-18e79.0.tgz", - "integrity": "sha1-zJ6sEawCthW3Z9a02dEXFjnrOoo=", + "version": "1.0.1-e1c84.0", + "resolved": "http://10.44.1.6:4873/@watsonb8%2fwiz-lib/-/wiz-lib-1.0.1-e1c84.0.tgz", + "integrity": "sha1-3dEF3v2j/oS7ezEBGCfq8wIhBng=", "dependencies": { "dgram": "^1.0.1", "getmac": "^5.20.0", @@ -1967,9 +1967,9 @@ "integrity": "sha512-XLD/llTSB6EBe3thkN+/I0L+yCTB6sjrcVovQdx2Cnl6N6bTzHmwe/J8mWnsXFgxLrj/emzdv8IR4evKYG2qxQ==" }, "@watsonb8/wiz-lib": { - "version": "1.0.1-18e79.0", - "resolved": "http://10.44.1.6:4873/@watsonb8%2fwiz-lib/-/wiz-lib-1.0.1-18e79.0.tgz", - "integrity": "sha1-zJ6sEawCthW3Z9a02dEXFjnrOoo=", + "version": "1.0.1-e1c84.0", + "resolved": "http://10.44.1.6:4873/@watsonb8%2fwiz-lib/-/wiz-lib-1.0.1-e1c84.0.tgz", + "integrity": "sha1-3dEF3v2j/oS7ezEBGCfq8wIhBng=", "requires": { "dgram": "^1.0.1", "getmac": "^5.20.0", diff --git a/package.json b/package.json index 3e00975..a8d4697 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "@types/node-cron": "^2.0.3", "@types/suncalc": "^1.8.0", - "@watsonb8/wiz-lib": "^1.0.1-62427.0", + "@watsonb8/wiz-lib": "^1.0.1-e1c84.0", "node-cron": "^2.0.3", "node-hue-api": "^4.0.5", "suncalc": "^1.8.0" @@ -44,4 +44,4 @@ "homebridge": "^1.5.0", "typescript": "^4.5.4" } -} \ No newline at end of file +} diff --git a/src/fluxAccessory.ts b/src/fluxAccessory.ts index bcc4c8c..0183e47 100644 --- a/src/fluxAccessory.ts +++ b/src/fluxAccessory.ts @@ -237,7 +237,7 @@ export class FluxAccessory { const sunsetColorTemp = this._config.sunsetColorTemp ?? 2800; const floorColorTemp = this._config.floorColorTemp ?? 1900; - let newTemp = 0; + let newTemp = this._config.ceilingColorTemp; if (start < now && now < sunsetStart) { newTemp = this.getTempOffset( @@ -314,7 +314,12 @@ export class FluxAccessory { } private updateWizLight = async (wizBulb: WizBulb): Promise => { - const pilot = await wizBulb.get(); + let pilot; + try { + pilot = await wizBulb.get(); + } catch (err: any) { + this._platform.log.error(err.message); + } this._platform.log.info(`Adjusting wiz bulb: ${wizBulb.getMac()}`); wizBulb.set(this._wizRGB, pilot?.state ? pilot.dimming : 0, this._fade); };