From 527f911ffb757a643c2fc5e4589495b7cedaca8c Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Fri, 23 Jul 2021 17:44:54 +0300 Subject: [PATCH] light: provide correct data to the /ws API RGB is a #RRGGBB hex string, not a R,G,B Current ltSaveDelay missing from the LIGHTS page --- code/espurna/light.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/espurna/light.cpp b/code/espurna/light.cpp index 293b141c..236d0a35 100644 --- a/code/espurna/light.cpp +++ b/code/espurna/light.cpp @@ -1689,7 +1689,7 @@ bool _lightWebSocketOnKeyCheck(const char * key, JsonVariant& value) { void _lightWebSocketStatus(JsonObject& root) { if (_light_has_color) { if (_light_use_rgb) { - root["rgb"] = lightRgbPayload(); + root["rgb"] = _lightRgbHexPayload(false); } else { root["hsv"] = lightHsvPayload(); } @@ -1721,6 +1721,7 @@ void _lightWebSocketOnConnected(JsonObject& root) { root["useTransitions"] = _light_use_transitions; root["useRGB"] = _light_use_rgb; root["ltSave"] = _light_save; + root["ltSaveDelay"] = _light_save_delay; root["ltTime"] = _light_transition_time; root["ltStep"] = _light_transition_step; #if RELAY_SUPPORT