From 9232ebae666da8780cce7429501f239801b8e58e Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Wed, 11 Sep 2019 23:44:21 +0300 Subject: [PATCH] ws: move cmdVisible to terminal module --- code/espurna/terminal.ino | 5 +++++ code/espurna/ws.ino | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/espurna/terminal.ino b/code/espurna/terminal.ino index d46409c9..d57818ab 100644 --- a/code/espurna/terminal.ino +++ b/code/espurna/terminal.ino @@ -408,6 +408,11 @@ void terminalSetup() { #endif }); + #if WEB_SUPPORT + wsRegister() + .onVisible([](JsonObject& root) { root["cmdVisible"] = 1; }); + #endif + _terminalInitCommand(); #if SERIAL_RX_ENABLED diff --git a/code/espurna/ws.ino b/code/espurna/ws.ino index b9780c80..933f718f 100644 --- a/code/espurna/ws.ino +++ b/code/espurna/ws.ino @@ -540,9 +540,6 @@ void _wsOnConnected(JsonObject& root) { root["btnDelay"] = getSetting("btnDelay", BUTTON_DBLCLICK_DELAY).toInt(); root["webPort"] = getSetting("webPort", WEB_PORT).toInt(); root["wsAuth"] = getSetting("wsAuth", WS_AUTHENTICATION).toInt() == 1; - #if TERMINAL_SUPPORT - root["cmdVisible"] = 1; - #endif root["hbMode"] = getSetting("hbMode", HEARTBEAT_MODE).toInt(); root["hbInterval"] = getSetting("hbInterval", HEARTBEAT_INTERVAL).toInt(); }