mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +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) => {
|
||||
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
|
||||
? this._configIsExposed(entity.entity_id, config)
|
||||
: filterFunc(entity.entity_id);
|
||||
@ -319,9 +321,7 @@ class CloudAlexa extends LitElement {
|
||||
}
|
||||
|
||||
private _configIsExposed(entityId: string, config: AlexaEntityConfig) {
|
||||
return config.should_expose === null
|
||||
? this._configIsDomainExposed(entityId)
|
||||
: config.should_expose;
|
||||
return config.should_expose ?? this._configIsDomainExposed(entityId);
|
||||
}
|
||||
|
||||
private async _exposeChanged(ev: CustomEvent<ActionDetail>) {
|
||||
|
@ -109,7 +109,9 @@ class CloudGoogleAssistant extends LitElement {
|
||||
|
||||
this._entities.forEach((entity) => {
|
||||
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
|
||||
? this._configIsExposed(entity.entity_id, config)
|
||||
: filterFunc(entity.entity_id);
|
||||
@ -324,9 +326,7 @@ class CloudGoogleAssistant extends LitElement {
|
||||
}
|
||||
|
||||
private _configIsExposed(entityId: string, config: GoogleEntityConfig) {
|
||||
return config.should_expose === null
|
||||
? this._configIsDomainExposed(entityId)
|
||||
: config.should_expose;
|
||||
return config.should_expose ?? this._configIsDomainExposed(entityId);
|
||||
}
|
||||
|
||||
private async _fetchData() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user