())) changed = true;
@@ -227,6 +241,14 @@ void _wsUpdate(JsonObject& root) {
#endif
}
+bool _wsOnReceive(const char * key, JsonVariant& value) {
+ if (strncmp(key, "ws", 2) == 0) return true;
+ if (strncmp(key, "admin", 5) == 0) return true;
+ if (strncmp(key, "hostname", 8) == 0) return true;
+ if (strncmp(key, "webPort", 7) == 0) return true;
+ return false;
+}
+
void _wsOnStart(JsonObject& root) {
#if USE_PASSWORD && WEB_FORCE_PASS_CHANGE
@@ -340,6 +362,10 @@ void wsOnSendRegister(ws_on_send_callback_f callback) {
_ws_on_send_callbacks.push_back(callback);
}
+void wsOnReceiveRegister(ws_on_receive_callback_f callback) {
+ _ws_on_receive_callbacks.push_back(callback);
+}
+
void wsOnActionRegister(ws_on_action_callback_f callback) {
_ws_on_action_callbacks.push_back(callback);
}
@@ -411,6 +437,7 @@ void wsSetup() {
mqttRegister(_wsMQTTCallback);
#endif
wsOnSendRegister(_wsOnStart);
+ wsOnReceiveRegister(_wsOnReceive);
wsOnAfterParseRegister(wsConfigure);
espurnaRegisterLoop(_wsLoop);
}
diff --git a/code/html/index.html b/code/html/index.html
index 8967de07..b3a54457 100644
--- a/code/html/index.html
+++ b/code/html/index.html
@@ -408,7 +408,7 @@
- Use forth dimmable channel as white when first 3 have the same RGB value. Will only work if the device has at least 4 dimmable channels. Reload the page to update the web interface.
+ Use forth dimmable channel as white when first 3 have the same RGB value. Will only work if the device has at least 4 dimmable channels. Enabling this will render useless the "Channel 4" slider in the status page. Reload the page to update the web interface.
@@ -435,9 +435,17 @@
If enabled color changes will be smoothed.
+
+
Transition time
+
+
+
+
Time in millisecons to transition from one color to another.
+
+
MQTT group
-
+
Sync color between different lights.
@@ -1047,7 +1055,7 @@
Power units
-
+
Watts (W)
Kilowatts (kW)
diff --git a/code/platformio.ini b/code/platformio.ini
index 47e9d6cc..2c1d9e93 100644
--- a/code/platformio.ini
+++ b/code/platformio.ini
@@ -26,7 +26,7 @@ lib_deps =
https://github.com/madpilot/mDNSResolver#4cfcda1
https://github.com/xoseperez/my92xx#3.0.1
https://bitbucket.org/xoseperez/nofuss.git#0.2.5
- https://github.com/gmag11/NtpClient.git#28af3a5
+ https://github.com/xoseperez/NtpClient.git#0016a59
OneWire
PMS Library
PZEM004T
@@ -1747,6 +1747,30 @@ upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}
+[env:arniex-swifitch]
+platform = ${common.platform}
+framework = arduino
+board = esp12e
+board_flash_mode = dout
+lib_deps = ${common.lib_deps}
+lib_ignore = ${common.lib_ignore}
+build_flags = ${common.build_flags_1m} -DARNIEX_SWIFITCH
+extra_scripts = ${common.extra_scripts}
+monitor_baud = 115200
+
+[env:arniex-swifitch-ota]
+platform = ${common.platform}
+framework = arduino
+board = esp12e
+board_flash_mode = dout
+lib_deps = ${common.lib_deps}
+lib_ignore = ${common.lib_ignore}
+build_flags = ${common.build_flags_1m} -DARNIEX_SWIFITCH
+upload_speed = 115200
+upload_port = "${env.ESPURNA_IP}"
+upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
+extra_scripts = ${common.extra_scripts}
+
# ------------------------------------------------------------------------------
# GENERIC OTA ENVIRONMENTS
# ------------------------------------------------------------------------------
diff --git a/images/devices/swifitch.png b/images/devices/swifitch.png
new file mode 100644
index 00000000..f43aba09
Binary files /dev/null and b/images/devices/swifitch.png differ