diff --git a/esphome/esp-reterminal-e1001.yaml b/esphome/esp-reterminal-e1001.yaml index e485eab..29458e2 100644 --- a/esphome/esp-reterminal-e1001.yaml +++ b/esphome/esp-reterminal-e1001.yaml @@ -949,7 +949,7 @@ script: const auto now = id(homeassistant_time).now(); const int64_t now_ts = now.is_valid() ? now.timestamp : 0; 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; auto append_text = [&](const std::string &value) { @@ -979,11 +979,7 @@ script: append_text(state); 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) { const int64_t remaining = static_cast(due_ts) - now_ts; const int hours = static_cast((remaining + 3599) / 3600); @@ -995,6 +991,12 @@ script: append_text("days"); append_number(days); } + } else if (state == "Due" && now_ts > 0 && !isnan(due_ts) && now_ts > due_ts) { + const int64_t since = static_cast(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(now_ts - due_ts); + append_number(since); } };