Various little fixes
This commit is contained in:
parent
2c4271c9f4
commit
5fbed48b80
@ -267,9 +267,9 @@ class {
|
|||||||
let v;
|
let v;
|
||||||
if(str[0].match(SPECIAL)) {
|
if(str[0].match(SPECIAL)) {
|
||||||
v = _parse_special(str.shift());
|
v = _parse_special(str.shift());
|
||||||
v = this.hass().states[v] || v;
|
v = this.hass.states[v] || v;
|
||||||
} else {
|
} else {
|
||||||
v = this.hass().states[`${str.shift()}.${str.shift()}`];
|
v = this.hass.states[`${str.shift()}.${str.shift()}`];
|
||||||
if(!str.length) return v['state'];
|
if(!str.length) return v['state'];
|
||||||
}
|
}
|
||||||
str.forEach(item => v=v[item]);
|
str.forEach(item => v=v[item]);
|
||||||
@ -338,9 +338,9 @@ class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static localize(key, def="") {
|
static localize(key, def="") {
|
||||||
const language = this.hass().language;
|
const language = this.hass.language;
|
||||||
if(this.hass().resources[language] && this.hass().resources[language][key])
|
if(this.hass.resources[language] && this.hass.resources[language][key])
|
||||||
return this.hass().resources[language][key];
|
return this.hass.resources[language][key];
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ class {
|
|||||||
</app-toolbar>
|
</app-toolbar>
|
||||||
`;
|
`;
|
||||||
popup.appendChild(message);
|
popup.appendChild(message);
|
||||||
cardTools.moreInfo(Object.keys(cardTools.hass().states)[0]);
|
this.moreInfo(Object.keys(this.hass.states)[0]);
|
||||||
let moreInfo = document.querySelector("home-assistant")._moreInfoEl;
|
let moreInfo = document.querySelector("home-assistant")._moreInfoEl;
|
||||||
moreInfo._page = "none";
|
moreInfo._page = "none";
|
||||||
moreInfo.shadowRoot.appendChild(popup);
|
moreInfo.shadowRoot.appendChild(popup);
|
||||||
@ -376,7 +376,7 @@ class {
|
|||||||
popup.parentNode.removeChild(popup);
|
popup.parentNode.removeChild(popup);
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
} else {
|
} else {
|
||||||
message.hass = cardTools.hass();
|
message.hass = this.hass;
|
||||||
}
|
}
|
||||||
}, 100)
|
}, 100)
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user