Edit esp-reterminal-e1001.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-30 20:16:42 +12:00
parent 6899fe7114
commit d4d0faf1f4
+8 -3
View File
@@ -903,7 +903,7 @@ script:
const auto now = id(homeassistant_time).now(); const auto now = id(homeassistant_time).now();
const int64_t now_ts = now.is_valid() ? now.timestamp : 0; const int64_t now_ts = now.is_valid() ? now.timestamp : 0;
const int hour_limit = ${job_hours_display_limit}; const int hour_limit = ${job_hours_display_limit};
const char *signature_prefix = "jobs-v0.8.0"; const char *signature_prefix = "jobs-v0.9.0";
std::string signature = signature_prefix; std::string signature = signature_prefix;
auto append_text = [&](const std::string &value) { auto append_text = [&](const std::string &value) {
@@ -928,11 +928,16 @@ script:
} }
auto append_job = [&](const std::string &state, float due_ts, auto append_job = [&](const std::string &state, float due_ts,
const std::string &completed_time) { const std::string &completed_time,
const std::string &elapsed) {
append_text(state); append_text(state);
if (state == "Complete") { if (state == "Complete") {
append_text(completed_time); if (!elapsed.empty() && elapsed != "unknown" && elapsed != "Never") {
append_text(elapsed);
} else {
append_text(completed_time);
}
} else if (state == "Not Due" && now_ts > 0 && !isnan(due_ts) && due_ts > now_ts) { } else if (state == "Not Due" && now_ts > 0 && !isnan(due_ts) && due_ts > now_ts) {
const int64_t remaining = static_cast<int64_t>(due_ts) - now_ts; const int64_t remaining = static_cast<int64_t>(due_ts) - now_ts;
const int hours = static_cast<int>((remaining + 3599) / 3600); const int hours = static_cast<int>((remaining + 3599) / 3600);