From 1b5c30712e393e31dfe70f1337b7ea01c42d1b45 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 22 Aug 2022 11:25:17 +0200 Subject: [PATCH] Rename exclude_attributes to hide_attributes for clarity (#13436) --- src/components/entity/ha-entity-attribute-picker.ts | 10 +++++----- src/components/ha-selector/ha-selector-attribute.ts | 2 +- src/data/selector.ts | 2 +- .../types/ha-automation-condition-numeric_state.ts | 2 +- .../condition/types/ha-automation-condition-state.ts | 2 +- .../types/ha-automation-trigger-numeric_state.ts | 2 +- .../trigger/types/ha-automation-trigger-state.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/entity/ha-entity-attribute-picker.ts b/src/components/entity/ha-entity-attribute-picker.ts index c79386d355..6fb98f55b9 100644 --- a/src/components/entity/ha-entity-attribute-picker.ts +++ b/src/components/entity/ha-entity-attribute-picker.ts @@ -16,12 +16,12 @@ class HaEntityAttributePicker extends LitElement { @property() public entityId?: string; /** - * List of attributes to be excluded. + * List of attributes to be hidden. * @type {Array} - * @attr exclude-attributes + * @attr hide-attributes */ - @property({ type: Array, attribute: "exclude-attributes" }) - public excludeAttributes?: string[]; + @property({ type: Array, attribute: "hide-attributes" }) + public hideAttributes?: string[]; @property({ type: Boolean }) public autofocus = false; @@ -51,7 +51,7 @@ class HaEntityAttributePicker extends LitElement { const state = this.entityId ? this.hass.states[this.entityId] : undefined; (this._comboBox as any).items = state ? Object.keys(state.attributes) - .filter((key) => !this.excludeAttributes?.includes(key)) + .filter((key) => !this.hideAttributes?.includes(key)) .map((key) => ({ value: key, label: formatAttributeName(key), diff --git a/src/components/ha-selector/ha-selector-attribute.ts b/src/components/ha-selector/ha-selector-attribute.ts index af66b97515..da06508e2f 100644 --- a/src/components/ha-selector/ha-selector-attribute.ts +++ b/src/components/ha-selector/ha-selector-attribute.ts @@ -32,7 +32,7 @@ export class HaSelectorAttribute extends SubscribeMixin(LitElement) { .hass=${this.hass} .entityId=${this.selector.attribute.entity_id || this.context?.filter_entity} - .excludeAttributes=${this.selector.attribute.exclude_attributes} + .hideAttributes=${this.selector.attribute.hide_attributes} .value=${this.value} .label=${this.label} .helper=${this.helper} diff --git a/src/data/selector.ts b/src/data/selector.ts index affeeb4bd9..10d0fb8bf1 100644 --- a/src/data/selector.ts +++ b/src/data/selector.ts @@ -65,7 +65,7 @@ export interface AreaSelector { export interface AttributeSelector { attribute: { entity_id?: string; - exclude_attributes?: readonly string[]; + hide_attributes?: readonly string[]; }; } diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts index 73974c5a15..b45dd1da83 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts @@ -28,7 +28,7 @@ export default class HaNumericStateCondition extends LitElement { selector: { attribute: { entity_id: entityId, - exclude_attributes: [ + hide_attributes: [ "access_token", "auto_update", "available_modes", diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts index fd4998893a..d34264466c 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts @@ -38,7 +38,7 @@ export class HaStateCondition extends LitElement implements ConditionElement { selector: { attribute: { entity_id: entityId, - exclude_attributes: [ + hide_attributes: [ "access_token", "available_modes", "color_modes", diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts index 763fca4bc3..5a3c95fad3 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts @@ -24,7 +24,7 @@ export class HaNumericStateTrigger extends LitElement { selector: { attribute: { entity_id: entityId, - exclude_attributes: [ + hide_attributes: [ "access_token", "auto_update", "available_modes", diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts index dcd0daafc3..bd46fca7cf 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts @@ -57,7 +57,7 @@ export class HaStateTrigger extends LitElement implements TriggerElement { selector: { attribute: { entity_id: entityId ? entityId[0] : undefined, - exclude_attributes: [ + hide_attributes: [ "access_token", "available_modes", "color_modes",