1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Closed #214 - Show last updated date on temperature profiles

This commit is contained in:
Jon Ziebell 2020-01-08 18:56:29 -05:00
parent 0910e60bee
commit b2239e4bbb

View File

@ -193,6 +193,32 @@ beestat.component.card.temperature_profiles.prototype.get_title_ = function() {
return 'Temperature Profiles';
};
/**
* Get the subtitle of the card.
*
* @return {string} The subtitle.
*/
beestat.component.card.temperature_profiles.prototype.get_subtitle_ = function() {
var thermostat = beestat.cache.thermostat[beestat.setting('thermostat_id')];
var thermostat_group = beestat.cache.thermostat_group[
thermostat.thermostat_group_id
];
/*
* All profiles are calculated at the same time, and resist is the most
* guaranteed one to have.
*/
if (thermostat_group.temperature_profile.resist !== undefined) {
var generated_at_m = moment(
thermostat_group.temperature_profile.resist.metadata.generated_at
);
return 'Generated ' + generated_at_m.format('MMM Do @ h a') + ' (updated weekly)';
}
return null;
};
/**
* Decorate the menu.
*