From d4cdbd7a35761bfaf2c38a067885738c4861ee8e Mon Sep 17 00:00:00 2001 From: VonOx Date: Mon, 23 Mar 2020 17:41:11 +0100 Subject: [PATCH 1/2] Handle LLC001 and LTW013 in hue service --- .../philips-hue/lib/light/light.getLights.js | 8 +- server/test/services/philips-hue/lights.json | 261 +++++++++++++++--- 2 files changed, 232 insertions(+), 37 deletions(-) diff --git a/server/services/philips-hue/lib/light/light.getLights.js b/server/services/philips-hue/lib/light/light.getLights.js index 4022071117..58ed002050 100644 --- a/server/services/philips-hue/lib/light/light.getLights.js +++ b/server/services/philips-hue/lib/light/light.getLights.js @@ -39,19 +39,21 @@ async function getLights() { case 'GL-C-008': // Non-hue LED Strip lightsToReturn.push(getPhilipsHueColorTemperatureLight(philipsHueLight, serialNumber, this.serviceId)); break; + case 'LLC001': // LivingColor lamp 2nd generation case 'LLC010': // Hue iris lightsToReturn.push(getPhilipsHueColorLight(philipsHueLight, serialNumber, this.serviceId)); break; - case 'LWB010': // hue white bulb with fixed warming light (2700K) + case 'LWB010': // Hue white bulb with fixed warming light (2700K) case 'LWB006': // Hue white lamp case 'LWG004': // Hue white spot case 'TRADFRI bulb E14 W op/ch 400lm': // IKEA white spot case 'TRADFRI bulb E27 W opal 1000lm': // IKEA white lamp lightsToReturn.push(getPhilipsHueWhiteLight(philipsHueLight, serialNumber, this.serviceId)); break; - case 'LTW012': // hue White Ambiance E12 - case 'LTW010': // hue White & Ambiance Bulb + case 'LTW012': // Hue White Ambiance E12 + case 'LTW010': // Hue White & Ambiance Bulb case 'LTW001': // Hue A19 White & Ambiance Bulb + case 'LTW013': // Hue White Ambiance GU10 lightsToReturn.push(getPhilipsHueWhiteTemperatureLight(philipsHueLight, serialNumber, this.serviceId)); break; case 'SP 120': // Innr Smart Plug On/Off diff --git a/server/test/services/philips-hue/lights.json b/server/test/services/philips-hue/lights.json index d6f88ecb23..dd186d81d4 100644 --- a/server/test/services/philips-hue/lights.json +++ b/server/test/services/philips-hue/lights.json @@ -8,9 +8,15 @@ "mindimlevel": 2000, "maxlumen": 800, "colorgamuttype": "other", - "ct": { "min": 0, "max": 65535 } + "ct": { + "min": 0, + "max": 65535 + } }, - "streaming": { "renderer": false, "proxy": false } + "streaming": { + "renderer": false, + "proxy": false + } } }, "state": { @@ -26,7 +32,10 @@ "mode": "homeautomation", "reachable": false }, - "swupdate": { "state": "transferring", "lastinstall": null }, + "swupdate": { + "state": "transferring", + "lastinstall": null + }, "type": "Extended color light", "name": "Hue color lamp 1", "modelid": "LCT007", @@ -292,9 +301,15 @@ "maxlumen": 540, "colorgamuttype": "C", "colorgamut": [[0.6915, 0.3083], [0.17, 0.7], [0.1532, 0.0475]], - "ct": { "min": 153, "max": 500 } + "ct": { + "min": 153, + "max": 500 + } }, - "streaming": { "renderer": true, "proxy": true } + "streaming": { + "renderer": true, + "proxy": true + } }, "config": { "archetype": "hueplay", @@ -303,7 +318,10 @@ "startup": { "mode": "custom", "configured": true, - "customsettings": { "bri": 254, "xy": [0.309, 0.3276] } + "customsettings": { + "bri": 254, + "xy": [0.309, 0.3276] + } } }, "uniqueid": "unique-id", @@ -346,9 +364,15 @@ "maxlumen": 806, "colorgamuttype": "C", "colorgamut": [[0.6915, 0.3083], [0.17, 0.7], [0.1532, 0.0475]], - "ct": { "min": 153, "max": 500 } + "ct": { + "min": 153, + "max": 500 + } }, - "streaming": { "renderer": true, "proxy": true } + "streaming": { + "renderer": true, + "proxy": true + } }, "config": { "archetype": "sultanbulb", @@ -357,7 +381,10 @@ "startup": { "mode": "custom", "configured": true, - "customsettings": { "bri": 254, "ct": 301 } + "customsettings": { + "bri": 254, + "ct": 301 + } } }, "uniqueid": "unique-id", @@ -389,14 +416,23 @@ "_rawData": { "capabilities": { "certified": true, - "control": { "mindimlevel": 2000, "maxlumen": 806 }, - "streaming": { "renderer": false, "proxy": false } + "control": { + "mindimlevel": 2000, + "maxlumen": 806 + }, + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "classicbulb", "function": "functional", "direction": "omnidirectional", - "startup": { "mode": "safety", "configured": true } + "startup": { + "mode": "safety", + "configured": true + } }, "uniqueid": "unique-id", "swversion": "1.46.13_r26312", @@ -426,14 +462,23 @@ "_rawData": { "capabilities": { "certified": true, - "control": { "mindimlevel": 2000, "maxlumen": 806 }, - "streaming": { "renderer": false, "proxy": false } + "control": { + "mindimlevel": 2000, + "maxlumen": 806 + }, + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "classicbulb", "function": "functional", "direction": "omnidirectional", - "startup": { "mode": "safety", "configured": true } + "startup": { + "mode": "safety", + "configured": true + } }, "uniqueid": "unique-id", "swversion": "1.46.13_r26312", @@ -468,15 +513,24 @@ "control": { "mindimlevel": 1000, "maxlumen": 806, - "ct": { "min": 153, "max": 454 } + "ct": { + "min": 153, + "max": 454 + } }, - "streaming": { "renderer": false, "proxy": false } + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "sultanbulb", "function": "functional", "direction": "omnidirectional", - "startup": { "mode": "powerfail", "configured": true } + "startup": { + "mode": "powerfail", + "configured": true + } }, "uniqueid": "unique-id", "swversion": "version" @@ -516,15 +570,24 @@ "maxlumen": 806, "colorgamuttype": "C", "colorgamut": [[0.6915, 0.3083], [0.17, 0.7], [0.1532, 0.0475]], - "ct": { "min": 153, "max": 500 } + "ct": { + "min": 153, + "max": 500 + } }, - "streaming": { "renderer": true, "proxy": true } + "streaming": { + "renderer": true, + "proxy": true + } }, "config": { "archetype": "sultanbulb", "function": "mixed", "direction": "omnidirectional", - "startup": { "mode": "powerfail", "configured": true } + "startup": { + "mode": "powerfail", + "configured": true + } }, "uniqueid": "unique-id", "swversion": "1.46.13_r26312", @@ -549,7 +612,10 @@ "mode": "homeautomation", "reachable": false }, - "swupdate": { "state": "notupdatable", "lastinstall": null }, + "swupdate": { + "state": "notupdatable", + "lastinstall": null + }, "type": "Extended color light", "name": "Led Strip bureau", "modelid": "GL-C-008", @@ -560,9 +626,15 @@ "certified": false, "control": { "colorgamuttype": "other", - "ct": { "min": 0, "max": 65535 } + "ct": { + "min": 0, + "max": 65535 + } }, - "streaming": { "renderer": false, "proxy": false } + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "classicbulb", @@ -583,7 +655,10 @@ "mode": "homeautomation", "reachable": true }, - "swupdate": { "state": "notupdatable", "lastinstall": null }, + "swupdate": { + "state": "notupdatable", + "lastinstall": null + }, "type": "On/Off plug-in unit", "name": "Guirlande", "modelid": "SP 120", @@ -593,7 +668,10 @@ "capabilities": { "certified": false, "control": {}, - "streaming": { "renderer": false, "proxy": false } + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "huelightstrip", @@ -637,13 +715,19 @@ "colorgamuttype": "A", "colorgamut": [[0.704, 0.296], [0.2151, 0.7106], [0.138, 0.08]] }, - "streaming": { "renderer": true, "proxy": false } + "streaming": { + "renderer": true, + "proxy": false + } }, "config": { "archetype": "hueiris", "function": "decorative", "direction": "upwards", - "startup": { "mode": "safety", "configured": true } + "startup": { + "mode": "safety", + "configured": true + } }, "uniqueid": "00:17:88:01:00:0d:b3:60-0b", "swversion": "5.127.1.26581" @@ -671,7 +755,10 @@ "capabilities": { "certified": false, "control": {}, - "streaming": { "renderer": false, "proxy": false } + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "christmastree", @@ -704,14 +791,23 @@ "_rawData": { "capabilities": { "certified": true, - "control": { "mindimlevel": 2000, "maxlumen": 800 }, - "streaming": { "renderer": false, "proxy": false } + "control": { + "mindimlevel": 2000, + "maxlumen": 800 + }, + "streaming": { + "renderer": false, + "proxy": false + } }, "config": { "archetype": "pendantround", "function": "functional", "direction": "omnidirectional", - "startup": { "mode": "safety", "configured": true } + "startup": { + "mode": "safety", + "configured": true + } }, "uniqueid": "00:17:88:01:10:40:cb:71-0b", "swversion": "5.127.1.26420" @@ -870,11 +966,11 @@ "bri": 86, "alert": "select", "mode": "homeautomation", - "reachable": false + "reachable": true }, "swupdate": { "state": "notupdatable", - "lastinstall": "2019-07-13T18:43:10" + "lastinstall": null }, "type": "Dimmable light", "name": "E14 1 sdb", @@ -900,6 +996,103 @@ }, "_id": 21, "id": 21 + }, + { + "state": { + "on": true, + "bri": 80, + "hue": 25951, + "sat": 254, + "effect": "none", + "xy": [0.2143, 0.7047], + "alert": "select", + "colormode": "xy", + "mode": "homeautomation", + "reachable": true + }, + "swupdate": { + "state": "notupdatable", + "lastinstall": null + }, + "type": "Color light", + "name": "LivingColors", + "modelid": "LLC001", + "manufacturername": "Signify Netherlands B.V.", + "productname": "LivingColors", + "_rawData": { + "capabilities": { + "certified": true, + "control": { + "colorgamuttype": "A", + "colorgamut": [[0.704, 0.296], [0.2151, 0.7106], [0.138, 0.08]] + }, + "streaming": { + "renderer": false, + "proxy": false + } + }, + "config": { + "archetype": "floorshade", + "function": "decorative", + "direction": "omnidirectional" + }, + "uniqueid": "00:17:88:01:00:06:b9:02-0b", + "swversion": "2.0.0.5206" + }, + "_id": 22, + "id": 22 + }, + { + "state": { + "on": true, + "bri": 144, + "ct": 443, + "alert": "none", + "colormode": "ct", + "mode": "homeautomation", + "reachable": true + }, + "swupdate": { + "state": "noupdates", + "lastinstall": "2020-03-02T21:43:51" + }, + "type": "Color temperature light", + "name": "spot bibliotheque 1", + "modelid": "LTW013", + "manufacturername": "Signify Netherlands B.V.", + "productname": "Hue ambiance spot", + "_rawData": { + "capabilities": { + "certified": true, + "control": { + "mindimlevel": 1000, + "maxlumen": 250, + "ct": { + "min": 153, + "max": 454 + } + }, + "streaming": { + "renderer": false, + "proxy": false + } + }, + "config": { + "archetype": "spotbulb", + "function": "functional", + "direction": "downwards", + "startup": { + "mode": "safety", + "configured": true + } + }, + "uniqueid": "00:17:88:01:02:31:00:d7-0b", + "swversion": "1.50.2_r30933", + "swconfigid": "FBD2BF7E", + "productid": "Philips-LTW013-1-GU10CTv1" + }, + "_id": 23, + "id": 23 } ] } From 9bb06367ff8ccfe3f4e4b063f0555d55dbb82edd Mon Sep 17 00:00:00 2001 From: VonOx Date: Sun, 3 May 2020 18:49:12 +0200 Subject: [PATCH 2/2] Handle LWO001 light in Hue Service --- .../philips-hue/lib/light/light.getLights.js | 1 + server/test/services/philips-hue/lights.json | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/server/services/philips-hue/lib/light/light.getLights.js b/server/services/philips-hue/lib/light/light.getLights.js index 58ed002050..0207cc40ad 100644 --- a/server/services/philips-hue/lib/light/light.getLights.js +++ b/server/services/philips-hue/lib/light/light.getLights.js @@ -43,6 +43,7 @@ async function getLights() { case 'LLC010': // Hue iris lightsToReturn.push(getPhilipsHueColorLight(philipsHueLight, serialNumber, this.serviceId)); break; + case 'LWO001': // Hue White Filament Bulb G93 E27 case 'LWB010': // Hue white bulb with fixed warming light (2700K) case 'LWB006': // Hue white lamp case 'LWG004': // Hue white spot diff --git a/server/test/services/philips-hue/lights.json b/server/test/services/philips-hue/lights.json index dd186d81d4..a6d12ecf1d 100644 --- a/server/test/services/philips-hue/lights.json +++ b/server/test/services/philips-hue/lights.json @@ -1093,6 +1093,52 @@ }, "_id": 23, "id": 23 + }, + { + "state": { + "on": true, + "bri": 254, + "alert": "none", + "mode": "homeautomation", + "reachable": true + }, + "swupdate": { + "state": "noupdates", + "lastinstall": "2019-10-06T19:48:01" + }, + "type": "Dimmable light", + "name": "Ampoule Hue salon", + "modelid": "LWO001", + "manufacturername": "Signify Netherlands B.V.", + "productname": "Hue filament bulb", + "_rawData": { + "capabilities": { + "certified": true, + "control": { + "mindimlevel": 2000, + "maxlumen": 550 + }, + "streaming": { + "renderer": false, + "proxy": false + } + }, + "config": { + "archetype": "vintagebulb", + "function": "decorative", + "direction": "omnidirectional", + "startup": { + "mode": "safety", + "configured": true + } + }, + "uniqueid": "00:17:88:01:08:9f:97:bd-0b", + "swversion": "1.65.9_hB3217DF", + "swconfigid": "E552ED14", + "productid": "Philips-LWO001-1-G93CFDLv1" + }, + "_id": 24, + "id": 24 } ] }