webui: update colorpicker

ref. https://github.com/xoseperez/espurna/issues/1132#issuecomment-431868924
it is slightly bigger, but better looking and no jquery dependency

rework colorpicker style as well, hide to prevent sending garbage when
lights are off. update lights module to send `lightState()` and separate
state from status payloads

yes, input[type="color"] is an option, but it does not look good
This commit is contained in:
Maxim Prokhorov
2021-01-15 21:41:33 +03:00
parent cfd6e36dbe
commit 808981ca39
26 changed files with 24388 additions and 24316 deletions

View File

@@ -1274,6 +1274,7 @@ void _lightWebSocketStatus(JsonObject& root) {
channels.add(lightChannel(id));
}
root["brightness"] = lightBrightness();
root["lightstate"] = lightState();
}
void _lightWebSocketOnVisible(JsonObject& root) {
@@ -1294,8 +1295,6 @@ void _lightWebSocketOnConnected(JsonObject& root) {
#if RELAY_SUPPORT
root["ltRelay"] = getSetting("ltRelay", 1 == LIGHT_RELAY_ENABLED);
#endif
_lightWebSocketStatus(root);
}
void _lightWebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) {
@@ -1842,6 +1841,7 @@ void lightSetup() {
wsRegister()
.onVisible(_lightWebSocketOnVisible)
.onConnected(_lightWebSocketOnConnected)
.onData(_lightWebSocketStatus)
.onAction(_lightWebSocketOnAction)
.onKeyCheck(_lightWebSocketOnKeyCheck);
#endif