mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Handle not defined entities (#6898)
This commit is contained in:
parent
e0bdef98a6
commit
eb96dd4803
@ -103,7 +103,9 @@ class CloudAlexa extends LitElement {
|
|||||||
|
|
||||||
this._entities.forEach((entity) => {
|
this._entities.forEach((entity) => {
|
||||||
const stateObj = this.hass.states[entity.entity_id];
|
const stateObj = this.hass.states[entity.entity_id];
|
||||||
const config = this._entityConfigs[entity.entity_id] || {};
|
const config = this._entityConfigs[entity.entity_id] || {
|
||||||
|
should_expose: null,
|
||||||
|
};
|
||||||
const isExposed = emptyFilter
|
const isExposed = emptyFilter
|
||||||
? this._configIsExposed(entity.entity_id, config)
|
? this._configIsExposed(entity.entity_id, config)
|
||||||
: filterFunc(entity.entity_id);
|
: filterFunc(entity.entity_id);
|
||||||
@ -319,9 +321,7 @@ class CloudAlexa extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _configIsExposed(entityId: string, config: AlexaEntityConfig) {
|
private _configIsExposed(entityId: string, config: AlexaEntityConfig) {
|
||||||
return config.should_expose === null
|
return config.should_expose ?? this._configIsDomainExposed(entityId);
|
||||||
? this._configIsDomainExposed(entityId)
|
|
||||||
: config.should_expose;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _exposeChanged(ev: CustomEvent<ActionDetail>) {
|
private async _exposeChanged(ev: CustomEvent<ActionDetail>) {
|
||||||
|
@ -109,7 +109,9 @@ class CloudGoogleAssistant extends LitElement {
|
|||||||
|
|
||||||
this._entities.forEach((entity) => {
|
this._entities.forEach((entity) => {
|
||||||
const stateObj = this.hass.states[entity.entity_id];
|
const stateObj = this.hass.states[entity.entity_id];
|
||||||
const config = this._entityConfigs[entity.entity_id] || {};
|
const config = this._entityConfigs[entity.entity_id] || {
|
||||||
|
should_expose: null,
|
||||||
|
};
|
||||||
const isExposed = emptyFilter
|
const isExposed = emptyFilter
|
||||||
? this._configIsExposed(entity.entity_id, config)
|
? this._configIsExposed(entity.entity_id, config)
|
||||||
: filterFunc(entity.entity_id);
|
: filterFunc(entity.entity_id);
|
||||||
@ -324,9 +326,7 @@ class CloudGoogleAssistant extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _configIsExposed(entityId: string, config: GoogleEntityConfig) {
|
private _configIsExposed(entityId: string, config: GoogleEntityConfig) {
|
||||||
return config.should_expose === null
|
return config.should_expose ?? this._configIsDomainExposed(entityId);
|
||||||
? this._configIsDomainExposed(entityId)
|
|
||||||
: config.should_expose;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _fetchData() {
|
private async _fetchData() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user