@section scripts{
+
-
}
\ No newline at end of file
diff --git a/projects/IoTCenter/iotcenter.db b/projects/IoTCenter/iotcenter.db
index d0336941..6db246fd 100644
Binary files a/projects/IoTCenter/iotcenter.db and b/projects/IoTCenter/iotcenter.db differ
diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
index ab80916d..1c186035 100644
--- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
+++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/js/node.js
@@ -457,9 +457,71 @@ function init() {
Vue.nextTick(function () {
ajax(url, null, 'get');
});
+ },
+ getLightColor(h, s, v) {
+ return hsvToRgb(parseInt(h * 360 / 255), parseInt(s * 100 / 255), parseInt(v * 100 / 255));
}
}
});
}
-/*exec*/
-loadData();
+function hsvToRgb(h, s, v) {
+ if (h == "") h = 0;
+ if (s == "") s = 0;
+ if (v == "") v = 0;
+ h = parseFloat(h);
+ s = parseFloat(s);
+ v = parseFloat(v);
+ if (h < 0) h = 0;
+ if (s < 0) s = 0;
+ if (v < 0) v = 0;
+ if (h >= 360) h = 359;
+ if (s > 100) s = 100;
+ if (v > 100) v = 100;
+ s /= 100.0;
+ v /= 100.0;
+ C = v * s;
+ hh = h / 60.0;
+ X = C * (1.0 - Math.abs((hh % 2) - 1.0));
+ r = g = b = 0;
+ if (hh >= 0 && hh < 1) {
+ r = C;
+ g = X;
+ }
+ else if (hh >= 1 && hh < 2) {
+ r = X;
+ g = C;
+ }
+ else if (hh >= 2 && hh < 3) {
+ g = C;
+ b = X;
+ }
+ else if (hh >= 3 && hh < 4) {
+ g = X;
+ b = C;
+ }
+ else if (hh >= 4 && hh < 5) {
+ r = X;
+ b = C;
+ }
+ else {
+ r = C;
+ b = X;
+ }
+ m = v - C;
+ r += m;
+ g += m;
+ b += m;
+ r *= 255.0;
+ g *= 255.0;
+ b *= 255.0;
+ r = Math.round(r);
+ g = Math.round(g);
+ b = Math.round(b);
+ hex = r * 65536 + g * 256 + b;
+ hex = hex.toString(16, 6);
+ len = hex.length;
+ if (len < 6)
+ for (i = 0; i < 6 - len; i++)
+ hex = '0' + hex;
+ return '#' + hex;
+}
\ No newline at end of file
diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
index ae3d6f62..313c2111 100644
--- a/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
+++ b/projects/IoTClient/Assets/StreamingAssets/wwwroot/node.html
@@ -77,7 +77,12 @@