mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-14 04:07:08 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user