Edit esp-reterminal-e1001.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-30 22:24:41 +12:00
parent e29b3406c6
commit 52e9e49b51
+7 -5
View File
@@ -949,7 +949,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.9.0"; const char *signature_prefix = "jobs-v0.9.3";
std::string signature = signature_prefix; std::string signature = signature_prefix;
auto append_text = [&](const std::string &value) { auto append_text = [&](const std::string &value) {
@@ -979,11 +979,7 @@ script:
append_text(state); append_text(state);
if (state == "Complete") { if (state == "Complete") {
if (!elapsed.empty() && elapsed != "unknown" && elapsed != "Never") {
append_text(elapsed);
} else {
append_text(completed_time); 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);
@@ -995,6 +991,12 @@ script:
append_text("days"); append_text("days");
append_number(days); append_number(days);
} }
} else if (state == "Due" && now_ts > 0 && !isnan(due_ts) && now_ts > due_ts) {
const int64_t since = static_cast<int64_t>(now_ts - due_ts);
append_number(since);
} else if (state == "Missed" && now_ts > 0 && !isnan(due_ts) && now_ts > due_ts) {
const int64_t since = static_cast<int64_t>(now_ts - due_ts);
append_number(since);
} }
}; };