diff --git a/src/panels/config/cloud/alexa/cloud-alexa.ts b/src/panels/config/cloud/alexa/cloud-alexa.ts index 5614318886..948d542680 100644 --- a/src/panels/config/cloud/alexa/cloud-alexa.ts +++ b/src/panels/config/cloud/alexa/cloud-alexa.ts @@ -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) { diff --git a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts index c29e22eaa0..49b56ea32c 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -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() {