Format the overview clock through a mutable ESPTime so ESPHome 2026.9.1 compiles.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Joshua King
2026-10-20 19:34:52 -04:00
co-authored by Cursor
parent c5b7408b18
commit 5b8a3f24c2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ def fleet_refresh_lines(snapshots):
'const auto clock = id(ha_time).now();',
'std::string clock_text = "--:--";',
'if (clock.is_valid()) {',
' clock_text = clock.strftime("%I:%M %p");',
' clock_text = esphome::ESPTime::from_epoch_local(clock.timestamp).strftime("%I:%M %p");',
' if (!clock_text.empty() && clock_text[0] == \'0\') clock_text.erase(0, 1);',
'}',
'bambu_display::set_text(id(fleet_clock), clock_text);',
+1 -1
View File
@@ -1748,7 +1748,7 @@ script:
const auto clock = id(ha_time).now();
std::string clock_text = "--:--";
if (clock.is_valid()) {
clock_text = clock.strftime("%I:%M %p");
clock_text = esphome::ESPTime::from_epoch_local(clock.timestamp).strftime("%I:%M %p");
if (!clock_text.empty() && clock_text[0] == '0') clock_text.erase(0, 1);
}
bambu_display::set_text(id(fleet_clock), clock_text);