Rename exclude_attributes to hide_attributes for clarity (#13436)

This commit is contained in:
Franck Nijhof 2022-08-22 11:25:17 +02:00 committed by GitHub
parent 7d3d800d4c
commit 1b5c30712e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 11 deletions

View File

@ -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),

View File

@ -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}

View File

@ -65,7 +65,7 @@ export interface AreaSelector {
export interface AttributeSelector {
attribute: {
entity_id?: string;
exclude_attributes?: readonly string[];
hide_attributes?: readonly string[];
};
}

View File

@ -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",

View File

@ -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",

View File

@ -24,7 +24,7 @@ export class HaNumericStateTrigger extends LitElement {
selector: {
attribute: {
entity_id: entityId,
exclude_attributes: [
hide_attributes: [
"access_token",
"auto_update",
"available_modes",

View File

@ -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",