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:
@@ -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);',
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user