mirror of
https://github.com/beestat/app.git
synced 2025-06-03 21:57:32 -04:00
Fixed TTT showing up even if the temperature has already been reached.
This commit is contained in:
parent
62a4d3852e
commit
6d359de3ca
@ -310,13 +310,31 @@ beestat.component.card.system.prototype.decorate_climate_ = function(parent) {
|
|||||||
*/
|
*/
|
||||||
beestat.component.card.system.prototype.decorate_time_to_temperature_ = function(parent) {
|
beestat.component.card.system.prototype.decorate_time_to_temperature_ = function(parent) {
|
||||||
const thermostat = beestat.cache.thermostat[this.thermostat_id_];
|
const thermostat = beestat.cache.thermostat[this.thermostat_id_];
|
||||||
|
const indoor_temperature = thermostat.temperature;
|
||||||
|
|
||||||
const operating_mode = beestat.thermostat.get_operating_mode(
|
const operating_mode = beestat.thermostat.get_operating_mode(
|
||||||
thermostat.thermostat_id
|
thermostat.thermostat_id
|
||||||
);
|
);
|
||||||
|
|
||||||
// System off; don't display anything.
|
// Convert "heat_1" etc to "heat"
|
||||||
if (operating_mode === 'off') {
|
const simplified_operating_mode = operating_mode.replace(/_\d/, '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the system is off or if we've already reached the setpoint, don't show
|
||||||
|
* this. The HVAC system can still be running due to minimum runtimes or if
|
||||||
|
* the setpoint changes suddenly.
|
||||||
|
*/
|
||||||
|
if (
|
||||||
|
operating_mode === 'off' ||
|
||||||
|
(
|
||||||
|
simplified_operating_mode === 'heat' &&
|
||||||
|
indoor_temperature >= thermostat.setpoint_heat
|
||||||
|
) ||
|
||||||
|
(
|
||||||
|
simplified_operating_mode === 'cool' &&
|
||||||
|
indoor_temperature <= thermostat.setpoint_cool
|
||||||
|
)
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,9 +346,6 @@ beestat.component.card.system.prototype.decorate_time_to_temperature_ = function
|
|||||||
});
|
});
|
||||||
parent.appendChild(container);
|
parent.appendChild(container);
|
||||||
|
|
||||||
// Convert "heat_1" etc to "heat"
|
|
||||||
const simplified_operating_mode = operating_mode.replace(/_\d/, '');
|
|
||||||
|
|
||||||
let header_text = 'Time to ' + simplified_operating_mode;
|
let header_text = 'Time to ' + simplified_operating_mode;
|
||||||
let text;
|
let text;
|
||||||
if (thermostat.profile.temperature[operating_mode] === null) {
|
if (thermostat.profile.temperature[operating_mode] === null) {
|
||||||
@ -353,7 +368,6 @@ beestat.component.card.system.prototype.decorate_time_to_temperature_ = function
|
|||||||
// If the degrees would display as 0.0/h, go for "never" as the time.
|
// If the degrees would display as 0.0/h, go for "never" as the time.
|
||||||
text = 'Never';
|
text = 'Never';
|
||||||
} else {
|
} else {
|
||||||
const indoor_temperature = thermostat.temperature;
|
|
||||||
let degrees_to_go;
|
let degrees_to_go;
|
||||||
let hours_to_go;
|
let hours_to_go;
|
||||||
switch (simplified_operating_mode) {
|
switch (simplified_operating_mode) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user