homebridge-xiaomi-yeelight
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -19,3 +19,3 @@ import { PlatformAccessory, CharacteristicValue } from 'homebridge'; | ||
constructor(platform: XiaomiYeelightPlatform, accessory: PlatformAccessory); | ||
convertColorTemp(value: number): number; | ||
convertColorTemp(value: number): string; | ||
/** | ||
@@ -22,0 +22,0 @@ * Handle "SET" requests from HomeKit |
@@ -58,3 +58,3 @@ "use strict"; | ||
convertColorTemp(value) { | ||
return Math.round(1000000 / value); | ||
return Math.round(1000000 / value).toString(); | ||
} | ||
@@ -133,5 +133,12 @@ /** | ||
this.state.ColorTemperature = value; | ||
// max brightness for ceiling22 | ||
if (value < 385) { | ||
value = 385; | ||
} | ||
else if (value > 163) { | ||
value = 163; | ||
} | ||
this.platform.log.info('setting color temp to', value, 'in kelvin:', this.convertColorTemp(value)); | ||
try { | ||
await this.connection.color(this.convertColorTemp(value), 'temperature'); | ||
await this.connection.color(`${this.convertColorTemp(400)}k`); | ||
this.platform.log.info('color temp set successfully'); | ||
@@ -138,0 +145,0 @@ } |
{ | ||
"displayName": "Xiaomi Yeelight Support", | ||
"name": "homebridge-xiaomi-yeelight", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "A short description about what your plugin does.", | ||
@@ -29,3 +29,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"miio-yeelight22": "^0.15.4" | ||
"miio-yeelight22": "^0.15.5" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45219
20
413
Updatedmiio-yeelight22@^0.15.5