mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 05:06:38 +00:00
Fix undefined on plant/weather card (#2339)
This commit is contained in:
parent
c46d04eaa6
commit
e20a02c52c
@ -119,7 +119,7 @@ class HaPlantCard extends EventsMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
computeTitle(stateObj) {
|
computeTitle(stateObj) {
|
||||||
return this.config.name || computeStateName(stateObj);
|
return (this.config && this.config.name) || computeStateName(stateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
computeAttributes(data) {
|
computeAttributes(data) {
|
||||||
|
@ -39,6 +39,7 @@ class HaWeatherCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
opacity: var(--dark-primary-opacity);
|
opacity: var(--dark-primary-opacity);
|
||||||
padding: 24px 16px 16px;
|
padding: 24px 16px 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
@ -195,6 +196,7 @@ class HaWeatherCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
hass: Object,
|
hass: Object,
|
||||||
|
config: Object,
|
||||||
stateObj: Object,
|
stateObj: Object,
|
||||||
forecast: {
|
forecast: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@ -274,7 +276,7 @@ class HaWeatherCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
computeName(stateObj) {
|
computeName(stateObj) {
|
||||||
return this.config.name || computeStateName(stateObj);
|
return (this.config && this.config.name) || computeStateName(stateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
showWeatherIcon(condition) {
|
showWeatherIcon(condition) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user