From 83455441fa2df4ce4886f5c2abb80a1dcd6dd46b Mon Sep 17 00:00:00 2001
From: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
Date: Sun, 1 Nov 2020 21:56:19 +0100
Subject: [PATCH] New LED Device - Cololight (#1070)
---
CHANGELOG.md | 8 +-
assets/webconfig/i18n/en.json | 7 +-
assets/webconfig/js/content_leds.js | 225 +++--
assets/webconfig/js/wizard.js | 296 +++++--
include/leddevice/LedDevice.h | 22 +-
libsrc/leddevice/LedDevice.cpp | 15 +
libsrc/leddevice/LedDeviceSchemas.qrc | 1 +
.../leddevice/dev_net/LedDeviceCololight.cpp | 772 ++++++++++++++++++
libsrc/leddevice/dev_net/LedDeviceCololight.h | 246 ++++++
libsrc/leddevice/dev_net/ProviderUdp.cpp | 12 +-
libsrc/leddevice/dev_net/ProviderUdp.h | 14 +-
.../leddevice/schemas/schema-cololight.json | 22 +
12 files changed, 1476 insertions(+), 164 deletions(-)
create mode 100644 libsrc/leddevice/dev_net/LedDeviceCololight.cpp
create mode 100644 libsrc/leddevice/dev_net/LedDeviceCololight.h
create mode 100644 libsrc/leddevice/schemas/schema-cololight.json
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99c19d8e..60dbb706 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Breaking
### Added
+- Cololight support (Cololight Plus & Strip) incl. configuration wizard
+- Provide additional details on Hardware/CPU information
+- Allow execution with option "--version", while another hyperion daemon is running
- New language support: Russian and Chinese (simplified) (#1005)
- added libcec to deb/rpm dependency list
- updated some language files
@@ -21,8 +24,7 @@ Allow execution with option "--version", while another hyperion daemon is runnin
- DirectX9 Grabber (#1039)
- Added DirectX SDK to CompileHowto
- Hide Systray on exit & Install DirectX Redistributable
-
-- Read-Only configuration database support
+- Read-Only configuration database suppor
### Changed
- boblight: reduce cpu time spent on memcopy and parsing rgb values (#1016)
@@ -33,6 +35,8 @@ Allow execution with option "--version", while another hyperion daemon is runnin
- Update LICENSE
- Change links from http to https (#1067)
+- UI: Separate LED-Layout creation from UI code
+
### Fixed
- Properly save Hue light state between sessions (#1014)
- AVAHI included in Webserver (#996)
diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json
index 5e6f3d9d..fdf6db78 100644
--- a/assets/webconfig/i18n/en.json
+++ b/assets/webconfig/i18n/en.json
@@ -855,7 +855,6 @@
"update_versreminder": "Your version: $1",
"wiz_atmoorb_desc2": "Now choose which Orbs should be added. The position assigns the lamp to a specific position on your \"picture\". Disabled lamps won't be added. To identify single lamps press the button on the right.",
"wiz_atmoorb_intro1": "This wizards configures Hyperion for AtmoOrbs. Features are the AtmoOrb auto detection, setting each light to a specific position on your picture or disable it and optimise the Hyperion settings automatically! So in short: All you need are some clicks and you are done!",
- "wiz_atmoorb_noLights": "No AtmoOrbs found! Please get the lights connected to the network or configure them manually.",
"wiz_atmoorb_title": "AtmoOrb Wizard",
"wiz_cc_adjustgamma": "Gamma: What you have to do is, adjust gamma levels of each channel until you have the same perceived amount of each channel. Hint: Neutral is 1.0! For example, if your Grey is a bit reddish it means that you have to increase red gamma to reduce the amount of red (the more gamma, the less amount of color).",
"wiz_cc_adjustit": "Adjust your \"$1\", until your are fine with it. Take notice: The more you adjust away from the default value the color spectrum will be limited (Also for all colors in between). Depending on TV/LED color spectrum the results will vary.",
@@ -879,6 +878,10 @@
"wiz_cc_testintrok": "Push on a button below to start a test video.",
"wiz_cc_testintrowok": "Check out the following link to download test videos:",
"wiz_cc_title": "Colour calibration wizard",
+ "wiz_cololight_desc2": "Now choose which Cololights should be added. To identify single lights, press the button on the right.",
+ "wiz_cololight_intro1": "This wizards configures Hyperion for the Cololight system. Features are the Cololight auto detection and tune the Hyperion settings automatically! In short: All you need are some clicks and you are done! Note: In case of Cololight Strip, you might need to manually correct the LED count and layout.",
+ "wiz_cololight_noprops": "Not able to get device properties - Define Hardware LED count manually",
+ "wiz_cololight_title": "Cololight Wizard",
"wiz_guideyou": "The $1 will guide you through the settings. Just press the button!",
"wiz_hue_blinkblue": "Let ID $1 light up blue",
"wiz_hue_clientkey": "Clientkey:",
@@ -912,6 +915,7 @@
"wiz_identify_light": "Identify $1",
"wiz_ids_disabled": "Deactivated",
"wiz_ids_entire": "Whole picture",
+ "wiz_noLights": "No $1 found! Please get the lights connected to the network or configure them manually.",
"wiz_pos": "Position/State",
"wiz_rgb_expl": "The color dot switches every x seconds the color (red, green), at the same time your LEDs switch the color too. Answer the questions at the bottom to check/correct your byte order.",
"wiz_rgb_intro1": "This wizard will guide you through the finding process of the correct color order for your leds. Click on continue to begin.",
@@ -924,7 +928,6 @@
"wiz_wizavail": "Wizard available",
"wiz_yeelight_desc2": "Now choose which lamps should be added. The position assigns the lamp to a specific position on your \"picture\". Disabled lamps won't be added. To identify single lamps press the button on the right.",
"wiz_yeelight_intro1": "This wizards configures Hyperion for the Yeelight system. Features are the Yeelighs' auto detection, setting each light to a specific position on your picture or disable it and tune the Hyperion settings automatically! So in short: All you need are some clicks and you are done!",
- "wiz_yeelight_noLights": "No Yeelights found! Please get the lights connected to the network or configure them manually.",
"wiz_yeelight_title": "Yeelight Wizard",
"wiz_yeelight_unsupported": "Unsupported"
}
diff --git a/assets/webconfig/js/content_leds.js b/assets/webconfig/js/content_leds.js
index 7080286c..d2c365ff 100644
--- a/assets/webconfig/js/content_leds.js
+++ b/assets/webconfig/js/content_leds.js
@@ -59,40 +59,36 @@ function createLedPreview(leds, origin){
}
-function createClassicLeds(){
- //get values
- var ledstop = parseInt($("#ip_cl_top").val());
- var ledsbottom = parseInt($("#ip_cl_bottom").val());
- var ledsleft = parseInt($("#ip_cl_left").val());
- var ledsright = parseInt($("#ip_cl_right").val());
- var ledsglength = parseInt($("#ip_cl_glength").val());
- var ledsgpos = parseInt($("#ip_cl_gpos").val());
- var position = parseInt($("#ip_cl_position").val());
- var reverse = $("#ip_cl_reverse").is(":checked");
+function createClassicLedLayoutSimple( ledstop,ledsleft,ledsright,ledsbottom,position,reverse ){
- //advanced values
- var ledsVDepth = parseInt($("#ip_cl_vdepth").val())/100;
- var ledsHDepth = parseInt($("#ip_cl_hdepth").val())/100;
- var edgeVGap = parseInt($("#ip_cl_edgegap").val())/100/2;
- //var cornerVGap = parseInt($("#ip_cl_cornergap").val())/100/2;
- var overlap = $("#ip_cl_overlap").val()/100;
+ let params = {
+ ledstop: 0, ledsleft: 0, ledsright: 0, ledsbottom: 0,
+ ledsglength: 0, ledsgpos: 0, position: 0,
+ ledsHDepth: 0.08, ledsVDepth: 0.05, overlap: 0,
+ edgeVGap: 0,
+ ptblh: 0, ptblv: 1, ptbrh: 1, ptbrv: 1,
+ pttlh: 0, pttlv: 0, pttrh: 1, pttrv: 0,
+ reverse:false
+ };
+
+ params.ledstop = ledstop;
+ params.ledsleft = ledsleft;
+ params.ledsright = ledsright;
+ params.ledsbottom = ledsbottom;
+ params.position = position;
+ params.reverse = reverse;
- //trapezoid values % -> float
- var ptblh = parseInt($("#ip_cl_pblh").val())/100;
- var ptblv = parseInt($("#ip_cl_pblv").val())/100;
- var ptbrh = parseInt($("#ip_cl_pbrh").val())/100;
- var ptbrv = parseInt($("#ip_cl_pbrv").val())/100;
- var pttlh = parseInt($("#ip_cl_ptlh").val())/100;
- var pttlv = parseInt($("#ip_cl_ptlv").val())/100;
- var pttrh = parseInt($("#ip_cl_ptrh").val())/100;
- var pttrv = parseInt($("#ip_cl_ptrv").val())/100;
+ return createClassicLedLayout( params );
+}
+
+function createClassicLedLayout( params ){
//helper
- var edgeHGap = edgeVGap/(16/9);
+ var edgeHGap = params.edgeVGap/(16/9);
var ledArray = [];
function createFinalArray(array){
- finalLedArray = [];
+ var finalLedArray = [];
for(var i = 0; i-1; i--){
- var hmin = ovl("-",ptblh+(steph*Number([i]))+edgeHGap);
- var hmax = ovl("+",ptblh+(steph*Number([i+1]))+edgeHGap);
- var vmax= ptblv+(stepv*Number([i]));
- var vmin = vmax-ledsHDepth;
+ for (var i = params.ledsbottom-1; i>-1; i--){
+ var hmin = ovl("-",params.ptblh+(steph*Number([i]))+edgeHGap);
+ var hmax = ovl("+",params.ptblh+(steph*Number([i+1]))+edgeHGap);
+ var vmax= params.ptblv+(stepv*Number([i]));
+ var vmin = vmax-params.ledsHDepth;
createLedArray(hmin, hmax, vmin, vmax);
}
}
function createLeftLeds(){
- var steph = (ptblh - pttlh)/ledsleft;
- var stepv = (ptblv - pttlv - (2*edgeVGap))/ledsleft;
+ var steph = (params.ptblh - params.pttlh)/params.ledsleft;
+ var stepv = (params.ptblv - params.pttlv - (2*params.edgeVGap))/params.ledsleft;
- for (var i = ledsleft-1; i>-1; i--){
- var hmin = pttlh+(steph*Number([i]));
- var hmax = hmin+ledsVDepth;
- var vmin = ovl("-",pttlv+(stepv*Number([i]))+edgeVGap);
- var vmax = ovl("+",pttlv+(stepv*Number([i+1]))+edgeVGap);
+ for (var i = params.ledsleft-1; i>-1; i--){
+ var hmin = params.pttlh+(steph*Number([i]));
+ var hmax = hmin+params.ledsVDepth;
+ var vmin = ovl("-",params.pttlv+(stepv*Number([i]))+params.edgeVGap);
+ var vmax = ovl("+",params.pttlv+(stepv*Number([i+1]))+params.edgeVGap);
createLedArray(hmin, hmax, vmin, vmax);
}
@@ -202,47 +198,87 @@ function createClassicLeds(){
createRightLeds();
createBottomLeds();
createLeftLeds();
-
+
//check led gap pos
- if (ledsgpos+ledsglength > ledArray.length)
+ if (params.ledsgpos+params.ledsglength > ledArray.length)
{
- var mpos = Math.max(0,ledArray.length-ledsglength);
- $('#ip_cl_ledsgpos').val(mpos);
+ var mpos = Math.max(0,ledArray.length-params.ledsglength);
+ //$('#ip_cl_ledsgpos').val(mpos);
ledsgpos = mpos;
}
//check led gap length
- if(ledsglength >= ledArray.length)
+ if(params.ledsglength >= ledArray.length)
{
- $('#ip_cl_ledsglength').val(ledArray.length-1);
- ledsglength = ledArray.length-ledsglength-1;
+ //$('#ip_cl_ledsglength').val(ledArray.length-1);
+ params.ledsglength = ledArray.length-params.ledsglength-1;
}
- if(ledsglength != 0){
- ledArray.splice(ledsgpos, ledsglength);
+ if(params.ledsglength != 0){
+ ledArray.splice(params.ledsgpos, params.ledsglength);
}
- if (position != 0){
- rotateArray(ledArray, position);
+ if (params.position != 0){
+ rotateArray(ledArray, params.position);
}
- if (reverse)
+ if (params.reverse)
ledArray.reverse();
- createFinalArray(ledArray);
+ return createFinalArray(ledArray);
}
-function createMatrixLeds(){
+function createClassicLeds(){
+
+ //get values
+ let params = {
+ ledstop : parseInt($("#ip_cl_top").val()),
+ ledsbottom : parseInt($("#ip_cl_bottom").val()),
+ ledsleft : parseInt($("#ip_cl_left").val()),
+ ledsright : parseInt($("#ip_cl_right").val()),
+ ledsglength : parseInt($("#ip_cl_glength").val()),
+ ledsgpos : parseInt($("#ip_cl_gpos").val()),
+ position : parseInt($("#ip_cl_position").val()),
+ reverse : $("#ip_cl_reverse").is(":checked"),
+
+ //advanced values
+ ledsVDepth : parseInt($("#ip_cl_vdepth").val())/100,
+ ledsHDepth : parseInt($("#ip_cl_hdepth").val())/100,
+ edgeVGap : parseInt($("#ip_cl_edgegap").val())/100/2,
+ //cornerVGap : parseInt($("#ip_cl_cornergap").val())/100/2,
+ overlap : $("#ip_cl_overlap").val()/100,
+
+ //trapezoid values % -> float
+ ptblh : parseInt($("#ip_cl_pblh").val())/100,
+ ptblv : parseInt($("#ip_cl_pblv").val())/100,
+ ptbrh : parseInt($("#ip_cl_pbrh").val())/100,
+ ptbrv : parseInt($("#ip_cl_pbrv").val())/100,
+ pttlh : parseInt($("#ip_cl_ptlh").val())/100,
+ pttlv : parseInt($("#ip_cl_ptlv").val())/100,
+ pttrh : parseInt($("#ip_cl_ptrh").val())/100,
+ pttrv : parseInt($("#ip_cl_ptrv").val())/100,
+ }
+
+ finalLedArray = createClassicLedLayout( params );
+
+ //check led gap pos
+ if (params.ledsgpos+params.ledsglength > finalLedArray.length) {
+ var mpos = Math.max(0,finalLedArray.length-params.ledsglength);
+ $('#ip_cl_ledsgpos').val(mpos);
+ }
+ //check led gap length
+ if(params.ledsglength >= finalLedArray.length) {
+ $('#ip_cl_ledsglength').val(finalLedArray.length-1);
+ }
+
+ createLedPreview(finalLedArray, 'classic');
+}
+
+
+function createMatrixLayout( ledshoriz, ledsvert, cabling, start){
// Big thank you to RanzQ (Juha Rantanen) from Github for this script
// https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js
- //get values
- var ledshoriz = parseInt($("#ip_ma_ledshoriz").val());
- var ledsvert = parseInt($("#ip_ma_ledsvert").val());
- var cabling = $("#ip_ma_cabling").val();
- //var order = $("#ip_ma_order").val();
- var start = $("#ip_ma_start").val();
-
var parallel = false
var leds = []
var hblock = 1.0 / ledshoriz
@@ -298,9 +334,23 @@ function createMatrixLeds(){
endX = tmp
}
}
- finalLedArray =[];
- finalLedArray = leds
- createLedPreview(leds, 'matrix');
+
+ return leds;
+}
+
+
+function createMatrixLeds(){
+// Big thank you to RanzQ (Juha Rantanen) from Github for this script
+// https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js
+
+ //get values
+ var ledshoriz = parseInt($("#ip_ma_ledshoriz").val());
+ var ledsvert = parseInt($("#ip_ma_ledsvert").val());
+ var cabling = $("#ip_ma_cabling").val();
+ var start = $("#ip_ma_start").val();
+
+ finalLedArray = createMatrixLayout(ledshoriz,ledsvert,cabling,start);
+ createLedPreview(finalLedArray, 'matrix');
}
function migrateLedConfig(slConfig){
@@ -560,6 +610,12 @@ $(document).ready(function() {
var atmoorb_title = 'wiz_atmoorb_title';
changeWizard(data, atmoorb_title, startWizardAtmoOrb);
}
+ else if(ledType == "cololight") {
+ var ledWizardType = (this.checked) ? "cololight" : ledType;
+ var data = { type: ledWizardType };
+ var cololight_title = 'wiz_cololight_title';
+ changeWizard(data, cololight_title, startWizardCololight);
+ }
else if(ledType == "yeelight") {
var ledWizardType = (this.checked) ? "yeelight" : ledType;
var data = { type: ledWizardType };
@@ -582,10 +638,11 @@ $(document).ready(function() {
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'sk9822', 'ws2812spi'];
var devRPiPWM = ['ws281x'];
var devRPiGPIO = ['piblaster'];
- var devNET = ['atmoorb', 'fadecandy', 'philipshue', 'nanoleaf', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udph801', 'udpraw', 'wled', 'yeelight'];
+
+ var devNET = ['atmoorb', 'cololight', 'fadecandy', 'philipshue', 'nanoleaf', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udph801', 'udpraw', 'wled', 'yeelight'];
var devUSB = ['adalight', 'dmx', 'atmo', 'hyperionusbasp', 'lightpack', 'paintpack', 'rawhid', 'sedu', 'tpm2', 'karate'];
- var optArr = [[]];
+ var optArr = [[]];
optArr[1]=[];
optArr[2]=[];
optArr[3]=[];
diff --git a/assets/webconfig/js/wizard.js b/assets/webconfig/js/wizard.js
index 1c62e885..73eb0568 100644
--- a/assets/webconfig/js/wizard.js
+++ b/assets/webconfig/js/wizard.js
@@ -152,9 +152,11 @@ function beginWizardRGB() {
$('#btn_wizard_byteorder').off().on('click', startWizardRGB);
//color calibration wizard
+
var kodiHost = document.location.hostname;
var kodiPort = 9090;
var kodiAddress = kodiHost;
+
var wiz_editor;
var colorLength;
var cobj;
@@ -168,6 +170,7 @@ var picnr = 0;
var availVideos = ["Sweet_Cocoon", "Caminandes_2_GranDillama", "Caminandes_3_Llamigos"];
if (getStorage("kodiAddress") != null) {
+
kodiAddress = getStorage("kodiAddress");
[kodiHost, kodiPort] = kodiAddress.split(":", 2);
@@ -585,6 +588,30 @@ function assignLightPos(id, pos, name) {
return i;
}
+function getHostInLights(hostname) {
+ return lights.filter(
+ function (lights) {
+ return lights.host === hostname
+ }
+ );
+}
+
+function getIpInLights(ip) {
+ return lights.filter(
+ function (lights) {
+ return lights.ip === ip
+ }
+ );
+}
+
+function getIdInLights(id) {
+ return lights.filter(
+ function (lights) {
+ return lights.id === id
+ }
+ );
+}
+
//****************************
// Wizard Philips Hue
//****************************
@@ -798,17 +825,8 @@ async function getProperties_hue_bridge(hostAddress, username, resourceFilter) {
}
function identify_hue_device(hostAddress, username, id) {
- console.log("identify_hue_device");
-
let params = { host: hostAddress, user: username, lightId: id };
-
- const res = requestLedDeviceIdentification("philipshue", params);
- // TODO: error case unhandled
- // res can be: false (timeout) or res.error (not found)
- if (res && !res.error) {
- const r = res.info
- console.log(r);
- }
+ requestLedDeviceIdentification("philipshue", params);
}
function getHueIPs() {
@@ -1271,14 +1289,7 @@ async function getProperties_wled(hostAddress, resourceFilter) {
function identify_wled(hostAddress) {
let params = { host: hostAddress };
-
- const res = requestLedDeviceIdentification("wled", params);
- // TODO: error case unhandled
- // res can be: false (timeout) or res.error (not found)
- if (res && !res.error) {
- const r = res.info
- console.log(r);
- }
+ requestLedDeviceIdentification("wled", params);
}
//****************************
@@ -1390,14 +1401,6 @@ function beginWizardYeelight() {
$('#btn_wiz_abort').off().on('click', resetWizard);
}
-function getHostInLights(hostname) {
- return lights.filter(
- function (lights) {
- return lights.host === hostname
- }
- );
-}
-
async function discover_yeelight_lights() {
var light = {};
// Get discovered lights
@@ -1414,10 +1417,9 @@ async function discover_yeelight_lights() {
if (device.hostname !== "") {
if (getHostInLights(device.hostname).length === 0) {
- light = {};
+ var light = {};
light.host = device.hostname;
light.port = device.port;
-
light.name = device.other.name;
light.model = device.other.model;
lights.push(light);
@@ -1435,7 +1437,7 @@ async function discover_yeelight_lights() {
if (host !== "")
if (getHostInLights(host).length === 0) {
- light = {};
+ var light = {};
light.host = host;
light.port = port;
light.name = configuredLights[keyConfig].name;
@@ -1454,7 +1456,7 @@ function assign_yeelight_lights() {
// If records are left for configuration
if (Object.keys(lights).length > 0) {
$('#wh_topcontainer').toggle(false);
- $('#yee_ids_t,#btn_wiz_save').toggle(true);
+ $('#yee_ids_t, #btn_wiz_save').toggle(true);
var lightOptions = [
"top", "topleft", "topright",
@@ -1486,7 +1488,7 @@ function assign_yeelight_lights() {
options += '>' + $.i18n(txt + val) + '';
}
- var enabled = 'enabled'
+ var enabled = 'enabled';
if (!models.includes(lights[lightid].model)) {
var enabled = 'disabled';
options = '';
@@ -1514,7 +1516,7 @@ function assign_yeelight_lights() {
$('.yee_sel_watch').trigger('change');
}
else {
- var noLightsTxt = '
' + $.i18n('wiz_yeelight_noLights') + '
';
+ var noLightsTxt = '
' + $.i18n('wiz_noLights','Yeelights') + '
';
$('#wizp2_body').append(noLightsTxt);
}
}
@@ -1535,13 +1537,8 @@ async function getProperties_yeelight(hostname, port) {
}
function identify_yeelight_device(hostname, port) {
- let params = { hostname: hostname, port: port };
- const res = requestLedDeviceIdentification("yeelight", params);
- // TODO: error case unhandled
- // res can be: false (timeout) or res.error (not found)
- if (res && !res.error) {
- //const r = res.info;
- }
+ let params = { hostname: hostname, port: port
+ requestLedDeviceIdentification("yeelight", params);
}
//****************************
@@ -1648,14 +1645,6 @@ function beginWizardAtmoOrb() {
$('#btn_wiz_abort').off().on('click', resetWizard);
}
-function getIdInLights(id) {
- return lights.filter(
- function (lights) {
- return lights.id === id
- }
- );
-}
-
async function discover_atmoorb_lights(multiCastGroup, multiCastPort) {
var light = {};
@@ -1673,13 +1662,13 @@ async function discover_atmoorb_lights(multiCastGroup, multiCastPort) {
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
- const r = res.info
-
+ const r = res.info;
+
// Process devices returned by discovery
for (const device of r.devices) {
if (device.id !== "") {
if (getIdInLights(device.id).length === 0) {
- light = {};
+ var light = {};
light.id = device.id;
light.ip = device.ip;
light.host = device.hostname;
@@ -1692,7 +1681,7 @@ async function discover_atmoorb_lights(multiCastGroup, multiCastPort) {
for (const keyConfig in configuredLights) {
if (configuredLights[keyConfig] !== "" && !isNaN(configuredLights[keyConfig])) {
if (getIdInLights(configuredLights[keyConfig]).length === 0) {
- light = {};
+ var light = {};
light.id = configuredLights[keyConfig];
light.ip = "";
light.host = "";
@@ -1743,9 +1732,9 @@ function assign_atmoorb_lights() {
options += '>' + $.i18n(txt + val) + '';
}
- var enabled = 'enabled'
+ var enabled = 'enabled';
if (orbId < 1 || orbId > 255) {
- enabled = 'disabled'
+ enabled = 'disabled';
options = '';
}
@@ -1775,20 +1764,14 @@ function assign_atmoorb_lights() {
$('.orb_sel_watch').trigger('change');
}
else {
- var noLightsTxt = '
' + $.i18n('wiz_atmoorb_noLights') + '
';
+ var noLightsTxt = '
' + $.i18n('wiz_noLights','AtmoOrbs') + '
';
$('#wizp2_body').append(noLightsTxt);
}
}
function identify_atmoorb_device(orbId) {
let params = { id: orbId };
-
- const res = requestLedDeviceIdentification("atmoorb", params);
- // TODO: error case unhandled
- // res can be: false (timeout) or res.error (not found)
- if (res && !res.error) {
- const r = res.info
- }
+ requestLedDeviceIdentification("atmoorb", params);
}
//****************************
@@ -1837,16 +1820,197 @@ async function getProperties_nanoleaf(hostAddress, authToken, resourceFilter) {
function identify_nanoleaf(hostAddress, authToken) {
let params = { host: hostAddress, token: authToken };
+ requestLedDeviceIdentification("nanoleaf", params);
+}
+
+//****************************
+// Wizard Cololight
+//****************************
+var lights = null;
+var selectedLightId = null;
+
+function startWizardCololight(e) {
+ //create html
+
+ var cololight_title = 'wiz_cololight_title';
+ var cololight_intro1 = 'wiz_cololight_intro1';
+
+ $('#wiz_header').html('' + $.i18n(cololight_title));
+ $('#wizp1_body').html('