Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
v00g100skr committed Jan 29, 2024
2 parents f353bc0 + 8abe14f commit 5294436
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/firmware-compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
- source-path: ${{ github.workspace }}/libs/Adafruit_GFX_Library
- source-path: ${{ github.workspace }}/libs/ArduinoAsync-master
- name: ESP Async WebServer
version: 2.5.1
version: 2.6.0
- name: Adafruit SSD1306
version: 2.5.7
- name: home-assistant-integration
Expand Down
Binary file modified libs/ESPAsyncWebServer-main.zip
Binary file not shown.
26 changes: 21 additions & 5 deletions src/firmware/firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1524,18 +1524,23 @@ void showHomeAlertInfo() {
displayMessage(message, getTextSizeToFitDisplay(message), title);
}

String getFwVersion(Firmware firmware) {
String version = String(latestFirmware.major) + "." + latestFirmware.minor;
if (latestFirmware.patch > 0) {
version += ".";
version += latestFirmware.patch;
}
return version;
}

void showNewFirmwareNotification() {
int toggleTime = 5; // seconds
int remainder = timeClient.getSeconds() % (toggleTime * 2);
String title;
String message;
if (remainder < toggleTime) {
title = "Доступне оновлення:";
message = (String) "v" + latestFirmware.major + "." + latestFirmware.minor;
if (latestFirmware.patch > 0) {
message += ".";
message += latestFirmware.patch;
}
message = (String) "v" + getFwVersion(latestFirmware);
} else if (settings.button_mode == 0) {
title = "Введіть у браузері:";
message = WiFi.localIP().toString();
Expand Down Expand Up @@ -1755,6 +1760,17 @@ void handleRoot(AsyncWebServerRequest* request) {
html += " </div>";
html += " </div>";
html += " </div>";
if (fwUpdateAvailable) {
html += " <div class='row'>";
html += " <div class='col-md-6 offset-md-3'>";
html += " <div class='row'>";
html += " <div class='box_yellow col-md-12 mt-2' style='background-color: #ffc107; color: #212529'>";
html += " <h8>Доспуна нова версія прошивки <a href='https://github.com/v00g100skr/ukraine_alarm_map/releases/tag/" + getFwVersion(latestFirmware) + "'>v" + getFwVersion(latestFirmware) + "</a></br>Для оновлення перейдіть в розділ \"Прошивка\"</h8>";
html += " </div>";
html += " </div>";
html += " </div>";
html += " </div>";
}
html += " <div class='row'>";
html += " <div class='col-md-6 offset-md-3'>";
html += " <div class='row'>";
Expand Down

0 comments on commit 5294436

Please sign in to comment.