From cf0bfadceee5e44205e26481331391f082a1cdc2 Mon Sep 17 00:00:00 2001 From: bwp91 <43026681+bwp91@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:35:50 +0100 Subject: [PATCH] try: brightness range for H6159 --- lib/device/led.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/device/led.js b/lib/device/led.js index 82d877d3..e0634700 100644 --- a/lib/device/led.js +++ b/lib/device/led.js @@ -106,6 +106,9 @@ module.exports = class deviceLED { externalUpdate (accessory, newParams) { const lightService = accessory.getService(Service.Lightbulb) + const newBrightness = accessory.context.gvModel === 'H6159' + ? newParams.brightness + : Math.round((newParams.brightness / 254) * 100) const rgb = {} if (utils.hasProperty(newParams, 'colorTemInKelvin')) { const rgbArray = cTemp.temp2rgb(newParams.colorTemInKelvin) @@ -120,7 +123,7 @@ module.exports = class deviceLED { const newColour = cConvert.rgb.hsv(rgb.r, rgb.g, rgb.b) lightService .updateCharacteristic(Characteristic.On, newParams.powerState === 'on') - .updateCharacteristic(Characteristic.Brightness, Math.round((newParams.brightness / 254) * 100)) + .updateCharacteristic(Characteristic.Brightness, newBrightness) .updateCharacteristic(Characteristic.Hue, newColour[0]) .updateCharacteristic(Characteristic.Saturation, newColour[1]) }