Remove "type" where "attribute: false" (#29356)

remove "type" when "attribute: false"
This commit is contained in:
ildar170975 2026-02-03 10:17:33 +03:00 committed by GitHub
parent 65ea0c9121
commit 9daac6c49f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
39 changed files with 54 additions and 56 deletions

View File

@ -58,7 +58,7 @@ export class HaSankeyChart extends LitElement {
@property({ type: Boolean }) public vertical = false;
@property({ type: String, attribute: false }) public valueFormatter?: (
@property({ attribute: false }) public valueFormatter?: (
value: number
) => string;

View File

@ -29,7 +29,7 @@ export class HaSunburstChart extends LitElement {
@property({ attribute: false }) public data?: SunburstNode;
@property({ type: String, attribute: false }) public valueFormatter?: (
@property({ attribute: false }) public valueFormatter?: (
value: number
) => string;

View File

@ -50,16 +50,16 @@ export class StateHistoryChartLine extends LitElement {
@property({ attribute: false }) public endTime!: Date;
@property({ attribute: false, type: Number }) public paddingYAxis = 0;
@property({ attribute: false }) public paddingYAxis = 0;
@property({ attribute: false, type: Number }) public chartIndex?;
@property({ attribute: false }) public chartIndex?;
@property({ attribute: "logarithmic-scale", type: Boolean })
public logarithmicScale = false;
@property({ attribute: false, type: Number }) public minYAxis?: number;
@property({ attribute: false }) public minYAxis?: number;
@property({ attribute: false, type: Number }) public maxYAxis?: number;
@property({ attribute: false }) public maxYAxis?: number;
@property({ attribute: "fit-y-data", type: Boolean }) public fitYData = false;

View File

@ -47,9 +47,9 @@ export class StateHistoryChartTimeline extends LitElement {
@property({ attribute: false }) public endTime!: Date;
@property({ attribute: false, type: Number }) public paddingYAxis = 0;
@property({ attribute: false }) public paddingYAxis = 0;
@property({ attribute: false, type: Number }) public chartIndex?;
@property({ attribute: false }) public chartIndex?;
@property({ attribute: "hide-reset-button", type: Boolean })
public hideResetButton?: boolean;

View File

@ -60,7 +60,7 @@ export class StateHistoryCharts extends LitElement {
@property({ type: Boolean, attribute: "up-to-now" }) public upToNow = false;
@property({ attribute: false, type: Number }) public hoursToShow?: number;
@property({ attribute: false }) public hoursToShow?: number;
@property({ attribute: "show-names", type: Boolean }) public showNames = true;
@ -73,9 +73,9 @@ export class StateHistoryCharts extends LitElement {
@property({ attribute: "logarithmic-scale", type: Boolean })
public logarithmicScale = false;
@property({ attribute: false, type: Number }) public minYAxis?: number;
@property({ attribute: false }) public minYAxis?: number;
@property({ attribute: false, type: Number }) public maxYAxis?: number;
@property({ attribute: false }) public maxYAxis?: number;
@property({ attribute: "fit-y-data", type: Boolean }) public fitYData = false;

View File

@ -62,14 +62,14 @@ export class StatisticsChart extends LitElement {
@property({ attribute: false }) public endTime?: Date;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public statTypes: StatisticType[] = ["sum", "min", "mean", "max"];
@property({ attribute: false }) public chartType: "line" | "bar" = "line";
@property({ attribute: false, type: Number }) public minYAxis?: number;
@property({ attribute: false }) public minYAxis?: number;
@property({ attribute: false, type: Number }) public maxYAxis?: number;
@property({ attribute: false }) public maxYAxis?: number;
@property({ attribute: "fit-y-data", type: Boolean }) public fitYData = false;

View File

@ -130,9 +130,9 @@ export class HaDataTable extends LitElement {
// eslint-disable-next-line lit/no-native-attributes
@property({ type: String }) public id = "id";
@property({ attribute: false, type: String }) public noDataText?: string;
@property({ attribute: false }) public noDataText?: string;
@property({ attribute: false, type: String }) public searchLabel?: string;
@property({ attribute: false }) public searchLabel?: string;
@property({ type: Boolean, attribute: "no-label-float" })
public noLabelFloat? = false;

View File

@ -48,7 +48,7 @@ export class HaDevicePicker extends LitElement {
@property({ type: String, attribute: "search-label" })
public searchLabel?: string;
@property({ attribute: false, type: Array }) public createDomains?: string[];
@property({ attribute: false }) public createDomains?: string[];
/**
* Show only devices with entities from specific domains.

View File

@ -76,7 +76,7 @@ class HaEntitiesPicker extends LitElement {
@property({ attribute: false })
public entityFilter?: HaEntityPickerEntityFilterFunc;
@property({ attribute: false, type: Array }) public createDomains?: string[];
@property({ attribute: false }) public createDomains?: string[];
@property({ type: Boolean })
public reorder = false;

View File

@ -58,7 +58,7 @@ export class HaEntityPicker extends LitElement {
@property({ type: String, attribute: "search-label" })
public searchLabel?: string;
@property({ attribute: false, type: Array }) public createDomains?: string[];
@property({ attribute: false }) public createDomains?: string[];
/**
* Show entities from specific domains.

View File

@ -78,7 +78,7 @@ export class HaStatisticPicker extends LitElement {
@property({ type: Boolean, attribute: "allow-custom-entity" })
public allowCustomEntity;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public statisticIds?: StatisticsMetaData[];
@property({ attribute: false }) public helpMissingEntityUrl =

View File

@ -11,7 +11,7 @@ class HaStatisticsPicker extends LitElement {
@property({ type: Array }) public value?: string[];
@property({ attribute: false, type: Array }) public statisticIds?: string[];
@property({ attribute: false }) public statisticIds?: string[];
@property({ attribute: "statistic-types" })
public statisticTypes?: "mean" | "sum";

View File

@ -36,7 +36,7 @@ export class HaAssistChat extends LitElement {
@property({ type: Boolean, attribute: "disable-speech" })
public disableSpeech = false;
@property({ type: Boolean, attribute: false })
@property({ attribute: false })
public startListening?: boolean;
@query("#message-input") private _messageInput!: HaTextField;

View File

@ -24,10 +24,10 @@ export class HaControlSwitch extends LitElement {
@property({ type: Boolean }) public checked = false;
// SVG icon path (if you need a non SVG icon instead, use the provided on icon slot to pass an <ha-icon slot="icon-on"> in)
@property({ attribute: false, type: String }) pathOn?: string;
@property({ attribute: false }) pathOn?: string;
// SVG icon path (if you need a non SVG icon instead, use the provided off icon slot to pass an <ha-icon slot="icon-off"> in)
@property({ attribute: false, type: String }) pathOff?: string;
@property({ attribute: false }) pathOff?: string;
@property({ type: String })
public label?: string;

View File

@ -30,7 +30,7 @@ export class HaGauge extends LitElement {
@property({ attribute: false })
public formatOptions?: Intl.NumberFormatOptions;
@property({ attribute: false, type: String }) public valueText?: string;
@property({ attribute: false }) public valueText?: string;
@property({ attribute: false }) public locale!: FrontendLocaleData;

View File

@ -48,7 +48,7 @@ export class HaGenericPicker extends PickerMixin(LitElement) {
section?: string
) => (PickerComboBoxItem | string)[] | undefined;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public getAdditionalItems?: (searchString?: string) => PickerComboBoxItem[];
@property({ attribute: false })

View File

@ -113,13 +113,13 @@ class HaHsColorPicker extends LitElement {
@property({ type: Boolean, reflect: true })
public disabled = false;
@property({ type: Number, attribute: false })
@property({ attribute: false })
public renderSize?: number;
@property({ type: Array })
public value?: [number, number];
@property({ attribute: false, type: Number })
@property({ attribute: false })
public colorBrightness?: number;
@property({ type: Number })
@ -131,10 +131,10 @@ class HaHsColorPicker extends LitElement {
@property({ type: Number })
public ww?: number;
@property({ attribute: false, type: Number })
@property({ attribute: false })
public minKelvin?: number;
@property({ attribute: false, type: Number })
@property({ attribute: false })
public maxKelvin?: number;
@query("#canvas") private _canvas!: HTMLCanvasElement;

View File

@ -19,7 +19,7 @@ export interface HaIconButtonToolbarItem {
@customElement("ha-icon-button-toolbar")
export class HaIconButtonToolbar extends LitElement {
@property({ type: Array, attribute: false })
@property({ attribute: false })
public items: (HaIconButtonToolbarItem | string)[] = [];
@queryAll("ha-icon-button") private _buttons?: HaIconButton[];

View File

@ -89,7 +89,7 @@ export class HaPasswordField extends LitElement {
@property({ type: Boolean }) readOnly = false;
// eslint-disable-next-line lit/no-native-attributes
@property({ attribute: false, type: String }) autocapitalize = "";
@property({ attribute: false }) autocapitalize = "";
@state() private _unmaskedPassword = false;

View File

@ -119,7 +119,7 @@ export class HaPickerComboBox extends ScrollableFadeMixin(LitElement) {
section?: string
) => PickerComboBoxItem[] | undefined;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public getAdditionalItems?: (searchString?: string) => PickerComboBoxItem[];
@property({ attribute: false })

View File

@ -22,7 +22,7 @@ export class HaQrCode extends LitElement {
@property({ type: Number })
public margin = 4;
@property({ attribute: false, type: Number })
@property({ attribute: false })
public maskPattern?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
@property({ attribute: "center-image" }) public centerImage?: string;

View File

@ -76,7 +76,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
@property({ type: Boolean, reflect: true }) public compact = false;
@property({ attribute: false, type: Array }) public createDomains?: string[];
@property({ attribute: false }) public createDomains?: string[];
/**
* Show only targets with entities from specific domains.

View File

@ -48,7 +48,7 @@ export class TopAppBarBaseBase extends BaseElement {
@query(".pane .ha-scrollbar") private _paneElement?: HTMLElement;
@property({ attribute: false, type: Object })
@property({ attribute: false })
get scrollTarget() {
return this._scrollTarget || window;
}

View File

@ -15,7 +15,7 @@ export class HaTileContainer extends LitElement {
@property({ type: Boolean })
public vertical = false;
@property({ type: Boolean, attribute: false })
@property({ attribute: false })
public interactive = false;
@property({ attribute: false })

View File

@ -134,7 +134,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
* String to show when there are no records in the data table.
* @type {String}
*/
@property({ attribute: false, type: String }) public noDataText?: string;
@property({ attribute: false }) public noDataText?: string;
/**
* Hides the data table and show an empty message.

View File

@ -13,7 +13,7 @@ class IntegrationBadge extends LitElement {
@property({ attribute: "dark-optimized-icon", type: Boolean })
public darkOptimizedIcon = false;
@property({ attribute: false, type: Boolean, reflect: true })
@property({ attribute: false })
public clickable = false;
protected render(): TemplateResult {

View File

@ -61,7 +61,7 @@ export class HaBackupDataPicker extends LitElement {
| "page-onboarding.restore"
| "config.backup" = "config.backup";
@property({ type: Boolean, attribute: false }) public addonsDisabled = false;
@property({ attribute: false }) public addonsDisabled = false;
@state() public _addonIcons: Record<string, boolean> = {};

View File

@ -30,7 +30,7 @@ class HaPanelDevStateRenderer extends LitElement {
@property({ type: Boolean, attribute: "virtualize", reflect: true })
public virtualize = true;
@property({ type: Boolean, attribute: false })
@property({ attribute: false })
public showAttributes = true;
protected willUpdate(changedProps: PropertyValues<this>) {

View File

@ -20,7 +20,7 @@ export class ZHAAddGroupPage extends LitElement {
@property({ type: Boolean }) public narrow = false;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public deviceEndpoints: ZHADeviceEndpoint[] = [];
@state() private _processingAdd = false;

View File

@ -30,7 +30,7 @@ export class ZHAClusterAttributes extends LitElement {
@property({ attribute: false }) public device?: ZHADevice;
@property({ attribute: false, type: Object })
@property({ attribute: false })
public selectedCluster?: Cluster;
@state() private _attributes: Attribute[] | undefined;

View File

@ -23,7 +23,7 @@ export class ZHAClusterCommands extends LitElement {
@property({ attribute: false }) public device?: ZHADevice;
@property({ attribute: false, type: Object })
@property({ attribute: false })
public selectedCluster?: Cluster;
@state() private _commands: Command[] | undefined;

View File

@ -31,7 +31,7 @@ export class ZHADeviceEndpointDataTable extends LitElement {
@property({ type: Boolean }) public selectable = false;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public deviceEndpoints: ZHADeviceEndpoint[] = [];
@query("ha-data-table", true) private _dataTable!: HaDataTable;

View File

@ -32,13 +32,13 @@ export class ZHAGroupPage extends LitElement {
@property({ type: Object }) public group?: ZHAGroup;
@property({ attribute: false, type: Number }) public groupId!: number;
@property({ attribute: false }) public groupId!: number;
@property({ type: Boolean }) public narrow = false;
@property({ attribute: "is-wide", type: Boolean }) public isWide = false;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public deviceEndpoints: ZHADeviceEndpoint[] = [];
@state() private _processingAdd = false;

View File

@ -17,8 +17,7 @@ export default class HaScriptFieldEditor extends LitElement {
@property() public key!: string;
@property({ attribute: false, type: Array }) public excludeKeys: string[] =
[];
@property({ attribute: false }) public excludeKeys: string[] = [];
@property({ attribute: false }) public field!: Field;

View File

@ -35,8 +35,7 @@ export default class HaScriptFieldRow extends LitElement {
@property() public key!: string;
@property({ attribute: false, type: Array }) public excludeKeys: string[] =
[];
@property({ attribute: false }) public excludeKeys: string[] = [];
@property({ attribute: false }) public field!: Field;

View File

@ -12,7 +12,7 @@ export class AssistPipelineDetailConfig extends LitElement {
@property({ attribute: false }) public data?: Partial<AssistPipeline>;
@property({ attribute: false, type: Array })
@property({ attribute: false })
public supportedLanguages?: string[];
public async focus() {

View File

@ -18,9 +18,9 @@ export class HuiSectionEditMode extends LitElement {
@property({ attribute: false }) public lovelace!: Lovelace;
@property({ attribute: false, type: Number }) public index!: number;
@property({ attribute: false }) public index!: number;
@property({ attribute: false, type: Number }) public viewIndex!: number;
@property({ attribute: false }) public viewIndex!: number;
protected render(): TemplateResult {
return html`

View File

@ -46,7 +46,7 @@ export class GridSection extends LitElement implements LovelaceSectionElement {
@property({ type: Number }) public index?: number;
@property({ attribute: false, type: Number }) public viewIndex?: number;
@property({ attribute: false }) public viewIndex?: number;
@property({ attribute: false }) public isStrategy = false;

View File

@ -50,7 +50,7 @@ export class HuiSection extends ConditionalListenerMixin<LovelaceSectionConfig>(
@property({ type: Number }) public index!: number;
@property({ attribute: false, type: Number }) public viewIndex!: number;
@property({ attribute: false }) public viewIndex!: number;
@state() private _cards: HuiCard[] = [];