Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Mar 5, 2024
1 parent d27eb91 commit e500a84
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 36 deletions.
15 changes: 7 additions & 8 deletions src/cards/chips-card/chips/conditional-chip-editor-legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,13 @@ export class ConditionalChipEditor extends LitElement implements LovelaceChipEdi
naturalMenuWidth
>
${CHIP_LIST.map(
(chip) =>
html`
<mwc-list-item .value=${chip}>
${customLocalize(
`editor.chip.chip-picker.types.${chip}`
)}
</mwc-list-item>
`
(chip) => html`
<mwc-list-item .value=${chip}>
${customLocalize(
`editor.chip.chip-picker.types.${chip}`
)}
</mwc-list-item>
`
)}
</mushroom-select>
`}
Expand Down
15 changes: 7 additions & 8 deletions src/cards/chips-card/chips/conditional-chip-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ export class ConditionalChipEditor extends LitElement implements LovelaceChipEdi
naturalMenuWidth
>
${CHIP_LIST.map(
(chip) =>
html`
<mwc-list-item .value=${chip}>
${customLocalize(
`editor.chip.chip-picker.types.${chip}`
)}
</mwc-list-item>
`
(chip) => html`
<mwc-list-item .value=${chip}>
${customLocalize(
`editor.chip.chip-picker.types.${chip}`
)}
</mwc-list-item>
`
)}
</mushroom-select>
`}
Expand Down
2 changes: 1 addition & 1 deletion src/cards/chips-card/chips/conditional-chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const setupConditionChipComponent = async () => {
});
}
const HuiConditionalBase = await loadCustomElement("hui-conditional-base");

// @ts-ignore
class ConditionalChip extends HuiConditionalBase implements LovelaceChip {
public static async getConfigElement(): Promise<LovelaceChipEditor> {
Expand Down
12 changes: 9 additions & 3 deletions src/cards/climate-card/climate-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ registerCustomCard({
});

@customElement(CLIMATE_CARD_NAME)
export class ClimateCard extends MushroomBaseCard<ClimateCardConfig, ClimateEntity> implements LovelaceCard {
export class ClimateCard
extends MushroomBaseCard<ClimateCardConfig, ClimateEntity>
implements LovelaceCard
{
public static async getConfigElement(): Promise<LovelaceCardEditor> {
await import("./climate-card-editor");
return document.createElement(CLIMATE_CARD_EDITOR_NAME) as LovelaceCardEditor;
Expand All @@ -70,7 +73,7 @@ export class ClimateCard extends MushroomBaseCard<ClimateCardConfig, ClimateEnti

private get _controls(): ClimateCardControl[] {
if (!this._config || !this._stateObj) return [];

const stateObj = this._stateObj;
const controls: ClimateCardControl[] = [];
if (isTemperatureControlVisible(stateObj) && this._config.show_temperature_control) {
Expand All @@ -96,6 +99,9 @@ export class ClimateCard extends MushroomBaseCard<ClimateCardConfig, ClimateEnti
tap_action: {
action: "toggle",
},
hold_action: {
action: "more-info",
},
...config,
});
this.updateActiveControl();
Expand All @@ -120,7 +126,7 @@ export class ClimateCard extends MushroomBaseCard<ClimateCardConfig, ClimateEnti
}

protected render() {
if (!this.hass || !this._config) {
if (!this.hass || !this._config || !this._config.entity) {
return nothing;
}

Expand Down
4 changes: 1 addition & 3 deletions src/cards/fan-card/controls/fan-oscillate-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export class FanPercentageControl extends LitElement {
.disabled=${!active}
>
<ha-icon
.icon=${oscillating
? "mdi:arrow-oscillating"
: "mdi:arrow-oscillating-off"}
.icon=${oscillating ? "mdi:arrow-oscillating" : "mdi:arrow-oscillating-off"}
></ha-icon>
</mushroom-button>
`;
Expand Down
2 changes: 1 addition & 1 deletion src/cards/lock-card/controls/lock-buttons-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class LockButtonsControl extends LitElement {

@property({ attribute: false }) public entity!: LockEntity;

@property({ type: Boolean }) public fill: boolean = false;
@property({ type: Boolean }) public fill: boolean = false;

private callService(e: CustomEvent) {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class MediaPlayerMediaControls extends LitElement {

@property({ attribute: false }) public controls!: MediaPlayerMediaControl[];

@property({ type: Boolean }) public fill: boolean = false;
@property({ type: Boolean }) public fill: boolean = false;

private _handleClick(e: MouseEvent): void {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MediaPlayerVolumeControls extends LitElement {

@property({ attribute: false }) public entity!: MediaPlayerEntity;

@property({ type: Boolean }) public fill: boolean = false;
@property({ type: Boolean }) public fill: boolean = false;

@property({ attribute: false }) public controls!: MediaPlayerVolumeControl[];

Expand Down
2 changes: 1 addition & 1 deletion src/cards/media-player-card/media-player-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class MediaPlayerCard
if (!this._config || !this.hass || !this._config.entity) {
return nothing;
}

const stateObj = this._stateObj;

if (!stateObj) {
Expand Down
2 changes: 1 addition & 1 deletion src/cards/number-card/number-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class NumberCard extends MushroomBaseCard<NumberCardConfig> implements Lo

updateValue() {
this.value = undefined;
const stateObj =this._stateObj;
const stateObj = this._stateObj;

if (!stateObj || Number.isNaN(stateObj.state)) return;
this.value = Number(stateObj.state);
Expand Down
2 changes: 1 addition & 1 deletion src/cards/vacuum-card/vacuum-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class VacuumCard
if (!this._config || !this.hass) {
return nothing;
}

const stateObj = this._stateObj;

if (!stateObj) {
Expand Down
13 changes: 6 additions & 7 deletions src/shared/editor/layout-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ export class LayoutPicker extends LitElement {
>
<ha-icon slot="icon" .icon=${ICONS[value as Layout]}></ha-icon>
${LAYOUTS.map(
(layout) =>
html`
<mwc-list-item .value=${layout} graphic="icon">
${customLocalize(`editor.form.layout_picker.values.${layout}`)}
<ha-icon slot="graphic" .icon=${ICONS[layout]}></ha-icon>
</mwc-list-item>
`
(layout) => html`
<mwc-list-item .value=${layout} graphic="icon">
${customLocalize(`editor.form.layout_picker.values.${layout}`)}
<ha-icon slot="graphic" .icon=${ICONS[layout]}></ha-icon>
</mwc-list-item>
`
)}
</mushroom-select>
`;
Expand Down

0 comments on commit e500a84

Please sign in to comment.