Fix climate rows. Add localize function

This commit is contained in:
2019-01-23 22:28:52 +01:00
parent 2940ee2bcb
commit 57fc14bbab
2 changed files with 21 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ class {
const DEFAULT_ROWS = {
alert: "toggle",
automation: "toggle",
climate: "toggle",
climate: "climate",
cover: "cover",
fan: "toggle",
group: "group",
@@ -133,6 +133,7 @@ class {
timer: "timer",
switch: "toggle",
vacuum: "toggle",
water_heater: "climate",
};
if(!config || typeof config !== "object" || (!config.entity && !config.type)) {
@@ -212,6 +213,13 @@ class {
return args;
}
static localize(key, def="") {
const language = this.hass().language;
if(this.hass().resources[language] && this.hass().resources[language][key])
return this.hass().resources[language][key];
return def;
}
});
// Global definition of cardTools