From 5b8a3f24c2175c38e79116276dd46da7780b9d15 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Tue, 20 Oct 2026 19:34:52 -0400 Subject: [PATCH] Format the overview clock through a mutable ESPTime so ESPHome 2026.9.1 compiles. Co-authored-by: Cursor --- esphome/bambu-display/generate.py | 2 +- esphome/bambu-display/generated.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/bambu-display/generate.py b/esphome/bambu-display/generate.py index 8205214..72bb865 100644 --- a/esphome/bambu-display/generate.py +++ b/esphome/bambu-display/generate.py @@ -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);', diff --git a/esphome/bambu-display/generated.yaml b/esphome/bambu-display/generated.yaml index 34368b8..d6e082d 100644 --- a/esphome/bambu-display/generated.yaml +++ b/esphome/bambu-display/generated.yaml @@ -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);