Dependency updates

This commit is contained in:
Djuri Baars 2024-04-28 16:47:57 +02:00
parent 4da04ca3ee
commit a2fa0a12a8
5 changed files with 66 additions and 7 deletions

View File

@ -37,7 +37,12 @@ jobs:
chip:
- name: lolin_s3_mini
version: esp32s3
- name: btclock_rev_b
version: esp32s3
epd_variant: [213epd, 29epd]
exclude:
- chip: btclock_rev_b
epd_variant: 29epd
steps:
- uses: actions/download-artifact@v4
with:

View File

@ -4,6 +4,6 @@ dependencies:
source:
type: idf
version: 4.4.6
manifest_hash: f4c10dfb616cf7e24f85cb263b8c89ef7d6d8eee64860fd27097b1a83ba56960
manifest_hash: c799a313787fb26f19e5716786e23d7a9f10f1cd0bbd7bc379c518bb5e67be3e
target: esp32s3
version: 1.0.0

View File

@ -15,7 +15,7 @@ default_envs = lolin_s3_mini_213epd, lolin_s3_mini_29epd, btclock_rev_b_213epd
[btclock_base]
platform = espressif32 @ ^6.5.0
platform = espressif32 @ ^6.6.0
framework = arduino, espidf
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, colorize
@ -32,15 +32,15 @@ build_unflags =
-fno-exceptions
lib_deps =
https://github.com/joltwallet/esp_littlefs.git
bblanchon/ArduinoJson@^7.0.3
bblanchon/ArduinoJson@^7.0.4
esphome/Improv@^1.2.3
mathieucarbou/ESP Async WebServer
adafruit/Adafruit BusIO@^1.15.0
adafruit/Adafruit BusIO@^1.16.0
adafruit/Adafruit MCP23017 Arduino Library@^2.3.2
adafruit/Adafruit NeoPixel@^1.12.0
https://github.com/dsbaars/universal_pin
https://github.com/dsbaars/GxEPD2#universal_pin
https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
https://github.com/tzapu/WiFiManager.git#v2.0.17
[env:lolin_s3_mini]
extends = btclock_base
@ -104,6 +104,14 @@ build_flags =
-D USE_QR
-D VERSION_EPD_2_9
[env:btclock_rev_b_29epd]
extends = env:btclock_rev_b
test_framework = unity
build_flags =
${env:btclock_rev_b.build_flags}
-D USE_QR
-D VERSION_EPD_2_9
[env:btclock_s3]
extends = btclock_base
board = btclock

View File

@ -54,6 +54,13 @@ void setupWebserver() {
server.on("/api/lights/color", HTTP_GET, onApiLightsSetColor);
server.on("/api/lights", HTTP_GET, onApiLightsStatus);
#ifdef HAS_FRONTLIGHT
server.on("/api/frontlight/on", HTTP_GET, onApiFrontlightOn);
server.on("/api/frontlight/status", HTTP_GET, onApiFrontlightStatus);
server.on("/api/frontlight/off", HTTP_GET, onApiFrontlightOff);
#endif
// server.on("^\\/api\\/lights\\/([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", HTTP_GET,
// onApiLightsSetColor);
@ -868,3 +875,36 @@ void eventSourceTask(void *pvParameters) {
eventSourceUpdate();
}
}
#ifdef HAS_FRONTLIGHT
void onApiFrontlightOn(AsyncWebServerRequest *request) {
frontlightFadeInAll();
request->send(200);
}
void onApiFrontlightStatus(AsyncWebServerRequest *request) {
AsyncResponseStream *response =
request->beginResponseStream("application/json");
JsonDocument root;
JsonArray ledStates = root["data"].to<JsonArray>();
for (int ledPin = 0; ledPin < NUM_SCREENS; ledPin++) {
uint16_t onTime, offTime;
flArray.getPWM(ledPin, &onTime, &offTime);
ledStates.add(onTime);
}
serializeJson(ledStates, *response);
request->send(response);
}
void onApiFrontlightOff(AsyncWebServerRequest *request) {
frontlightFadeOutAll();
request->send(200);
}
#endif

View File

@ -53,3 +53,9 @@ void eventSourceTask(void *pvParameters);
void onApiStopDataSources(AsyncWebServerRequest *request);
void onApiRestartDataSources(AsyncWebServerRequest *request);
#ifdef HAS_FRONTLIGHT
void onApiFrontlightOn(AsyncWebServerRequest *request);
void onApiFrontlightStatus(AsyncWebServerRequest *request);
void onApiFrontlightOff(AsyncWebServerRequest *request);
#endif