mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 02:20:02 +01:00
Fix light control API functionality, changed light setting endpoints
This commit is contained in:
parent
474ddbb086
commit
491618dd78
2
data
2
data
@ -1 +1 @@
|
|||||||
Subproject commit e859adac8631c6380a6a3f8b20b118a5531d4f8c
|
Subproject commit 4f15eee72bcd3873a0edb61bc77638a0ff5e3724
|
@ -722,7 +722,7 @@ void setupFrontlight()
|
|||||||
}
|
}
|
||||||
if (!preferences.isKey("flEffectDelay"))
|
if (!preferences.isKey("flEffectDelay"))
|
||||||
{
|
{
|
||||||
preferences.putUInt("flEffectDelay", 5);
|
preferences.putUInt("flEffectDelay", 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preferences.isKey("flFlashOnUpd"))
|
if (!preferences.isKey("flFlashOnUpd"))
|
||||||
|
@ -6,7 +6,7 @@ Adafruit_NeoPixel pixels(NEOPIXEL_COUNT, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
|
|||||||
uint ledTaskParams;
|
uint ledTaskParams;
|
||||||
|
|
||||||
#ifdef HAS_FRONTLIGHT
|
#ifdef HAS_FRONTLIGHT
|
||||||
#define FL_FADE_STEP 50
|
#define FL_FADE_STEP 25
|
||||||
|
|
||||||
bool frontlightOn = false;
|
bool frontlightOn = false;
|
||||||
bool flInTransition = false;
|
bool flInTransition = false;
|
||||||
@ -15,13 +15,13 @@ void frontlightFlash(int flDelayTime)
|
|||||||
{
|
{
|
||||||
if (frontlightOn)
|
if (frontlightOn)
|
||||||
{
|
{
|
||||||
frontlightFadeOutAll(flDelayTime);
|
frontlightFadeOutAll(flDelayTime, true);
|
||||||
frontlightFadeInAll(flDelayTime);
|
frontlightFadeInAll(flDelayTime, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frontlightFadeInAll(flDelayTime);
|
frontlightFadeInAll(flDelayTime, true);
|
||||||
frontlightFadeOutAll(flDelayTime);
|
frontlightFadeOutAll(flDelayTime, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,6 +264,7 @@ void ledTask(void *parameter)
|
|||||||
#ifdef HAS_FRONTLIGHT
|
#ifdef HAS_FRONTLIGHT
|
||||||
if (preferences.getBool("flFlashOnUpd", false))
|
if (preferences.getBool("flFlashOnUpd", false))
|
||||||
{
|
{
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(10));
|
||||||
if (frontlightWasOn)
|
if (frontlightWasOn)
|
||||||
{
|
{
|
||||||
frontlightFadeInAll(1);
|
frontlightFadeInAll(1);
|
||||||
|
@ -46,7 +46,7 @@ void setupWebserver()
|
|||||||
server.addHandler(handler);
|
server.addHandler(handler);
|
||||||
|
|
||||||
AsyncCallbackJsonWebHandler *lightsJsonHandler =
|
AsyncCallbackJsonWebHandler *lightsJsonHandler =
|
||||||
new AsyncCallbackJsonWebHandler("/api/lights", onApiLightsSetJson);
|
new AsyncCallbackJsonWebHandler("/api/lights/set", onApiLightsSetJson);
|
||||||
server.addHandler(lightsJsonHandler);
|
server.addHandler(lightsJsonHandler);
|
||||||
|
|
||||||
server.on("/api/lights/off", HTTP_GET, onApiLightsOff);
|
server.on("/api/lights/off", HTTP_GET, onApiLightsOff);
|
||||||
@ -68,7 +68,7 @@ void setupWebserver()
|
|||||||
// onApiLightsSetColor);
|
// onApiLightsSetColor);
|
||||||
|
|
||||||
server.on("/api/restart", HTTP_GET, onApiRestart);
|
server.on("/api/restart", HTTP_GET, onApiRestart);
|
||||||
server.addRewrite(new OneParamRewrite("/api/lights/{color}",
|
server.addRewrite(new OneParamRewrite("/api/lights/color/{color}",
|
||||||
"/api/lights/color?c={color}"));
|
"/api/lights/color?c={color}"));
|
||||||
server.addRewrite(
|
server.addRewrite(
|
||||||
new OneParamRewrite("/api/show/screen/{s}", "/api/show/screen?s={s}"));
|
new OneParamRewrite("/api/show/screen/{s}", "/api/show/screen?s={s}"));
|
||||||
|
Loading…
Reference in New Issue
Block a user