Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/panels/config/cloud/alexa/cloud-alexa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down