From 8c507918b60aba5f4594a4609469a8bf3b93fadb Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Thu, 6 Jan 2022 18:17:17 -0500 Subject: [PATCH] Fixed #349 - Time to heat can report times in the past Had some bad logic. --- js/component/card/system.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/component/card/system.js b/js/component/card/system.js index b150374..ed88418 100644 --- a/js/component/card/system.js +++ b/js/component/card/system.js @@ -373,8 +373,17 @@ beestat.component.card.system.prototype.decorate_time_to_temperature_ = function }) + ' / h)'; - if (Math.abs(degrees_per_hour) < 0.05) { - // If the degrees would display as 0.0/h, go for "never" as the time. + if ( + ( + simplified_operating_mode === 'heat' && + degrees_per_hour < 0.05 + ) || + ( + simplified_operating_mode === 'cool' && + degrees_per_hour > -0.05 + ) + ) { + // If the degrees would display as 0.0/h, go for "Never" as the time. text = 'Never'; } else { let degrees_to_go;