diff --git a/examples/SmartSwitch/1.PNG b/examples/SmartSwitch/1.PNG
new file mode 100644
index 0000000..3c95d81
Binary files /dev/null and b/examples/SmartSwitch/1.PNG differ
diff --git a/examples/SmartSwitch/2.PNG b/examples/SmartSwitch/2.PNG
new file mode 100644
index 0000000..6c02cab
Binary files /dev/null and b/examples/SmartSwitch/2.PNG differ
diff --git a/examples/SmartSwitch/3.PNG b/examples/SmartSwitch/3.PNG
new file mode 100644
index 0000000..258c51c
Binary files /dev/null and b/examples/SmartSwitch/3.PNG differ
diff --git a/examples/SmartSwitch/4.PNG b/examples/SmartSwitch/4.PNG
new file mode 100644
index 0000000..56947d5
Binary files /dev/null and b/examples/SmartSwitch/4.PNG differ
diff --git a/examples/SmartSwitch/AWIFIMAN.JPG b/examples/SmartSwitch/AWIFIMAN.JPG
deleted file mode 100644
index 46f38f4..0000000
Binary files a/examples/SmartSwitch/AWIFIMAN.JPG and /dev/null differ
diff --git a/examples/SmartSwitch/README.md b/examples/SmartSwitch/README.md
index ac61481..1d5171a 100644
--- a/examples/SmartSwitch/README.md
+++ b/examples/SmartSwitch/README.md
@@ -1,4 +1,6 @@
- 
+ 
+##
+ 
## SmartSwitch
* Remote Temperature Control application with schedule (example car block heater or battery charger)
diff --git a/examples/SmartSwitch/SCREENSHOT.PNG b/examples/SmartSwitch/SCREENSHOT.PNG
deleted file mode 100644
index 001cc56..0000000
Binary files a/examples/SmartSwitch/SCREENSHOT.PNG and /dev/null differ
diff --git a/examples/SmartSwitch/data/index.htm b/examples/SmartSwitch/data/index.htm
index 7c28036..6f2c731 100644
--- a/examples/SmartSwitch/data/index.htm
+++ b/examples/SmartSwitch/data/index.htm
@@ -242,6 +242,7 @@
border-radius: 50%;
background: white
}
+
@@ -251,13 +252,13 @@
|
@@ -332,6 +333,7 @@
const MYCORS = '192.168.0.12';
var g1, g2;
var Analog0 = new Array();
+ var auto = true;
const successNotification = window.createNotification({
positionClass: 'nfc-bottom-right',
@@ -454,9 +456,16 @@
else if (delta < -0.5) document.getElementById("W").style.backgroundColor = "#2196f3";
break;
case "Clock":
- var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'];
- var dayName = days[parseInt(msgArray[3])] || '*'; // 0...6
+ var dn = parseInt(msgArray[3]);
+ var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+ var dayName = days[dn] || '*'; // 0...6
+ var shedtype = 0;
+ if (dn == 0) shedtype = 3;
+ else if (dn == 6) shedtype = 2;
+ else if ((dn > 0) && (dn < 6)) shedtype = 1;
document.getElementById('C').innerHTML = msgArray[2] + ' ' + dayName;
+ if (auto) document.getElementById('LZ' + shedtype).classList.add('son');
+ else document.getElementById('LZ' + shedtype).classList.remove('son');
break;
case "Setting":
document.getElementById('input-popup-start').value = msgArray[2];
@@ -545,6 +554,9 @@
};
function handleClick(e) {
+ if (e.value == 'Z0' ) auto = true;
+ else auto = false;
+ document.getElementById('L' + e.value).classList.remove('son');
if (connection.readyState === WebSocket.OPEN) connection.send(e.value + "|");
}
diff --git a/examples/SmartSwitch/data_src/index.htm b/examples/SmartSwitch/data_src/index.htm
index 7c28036..6f2c731 100644
--- a/examples/SmartSwitch/data_src/index.htm
+++ b/examples/SmartSwitch/data_src/index.htm
@@ -242,6 +242,7 @@
border-radius: 50%;
background: white
}
+
@@ -251,13 +252,13 @@
|
@@ -332,6 +333,7 @@
const MYCORS = '192.168.0.12';
var g1, g2;
var Analog0 = new Array();
+ var auto = true;
const successNotification = window.createNotification({
positionClass: 'nfc-bottom-right',
@@ -454,9 +456,16 @@
else if (delta < -0.5) document.getElementById("W").style.backgroundColor = "#2196f3";
break;
case "Clock":
- var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'];
- var dayName = days[parseInt(msgArray[3])] || '*'; // 0...6
+ var dn = parseInt(msgArray[3]);
+ var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+ var dayName = days[dn] || '*'; // 0...6
+ var shedtype = 0;
+ if (dn == 0) shedtype = 3;
+ else if (dn == 6) shedtype = 2;
+ else if ((dn > 0) && (dn < 6)) shedtype = 1;
document.getElementById('C').innerHTML = msgArray[2] + ' ' + dayName;
+ if (auto) document.getElementById('LZ' + shedtype).classList.add('son');
+ else document.getElementById('LZ' + shedtype).classList.remove('son');
break;
case "Setting":
document.getElementById('input-popup-start').value = msgArray[2];
@@ -545,6 +554,9 @@
};
function handleClick(e) {
+ if (e.value == 'Z0' ) auto = true;
+ else auto = false;
+ document.getElementById('L' + e.value).classList.remove('son');
if (connection.readyState === WebSocket.OPEN) connection.send(e.value + "|");
}