Bump prettier to v3 and format all files

This commit is contained in:
Felipe Santos
2024-06-10 00:29:50 -03:00
parent 2a637d92b9
commit fccb4c9afd
138 changed files with 6445 additions and 1678 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
import { HomeAssistant } from "@dermotduffy/custom-card-helpers";
import { HassEntity } from "home-assistant-js-websocket";
import { CameraConfig } from "../config/types.js";
import { dispatchErrorMessageEvent } from "../components/message.js";
import { localize } from "../localize/localize.js";
import { HomeAssistant } from '@dermotduffy/custom-card-helpers';
import { HassEntity } from 'home-assistant-js-websocket';
import { CameraConfig } from '../config/types.js';
import { dispatchErrorMessageEvent } from '../components/message.js';
import { localize } from '../localize/localize.js';
/**
* Get the state object or dispatch an error. Used in `ha` and `image` live
+1 -1
View File
@@ -6,7 +6,7 @@ const deviceSchema = z.object({
model: z.string().nullable(),
config_entries: z.string().array(),
manufacturer: z.string().nullable(),
})
});
const deviceListSchema = deviceSchema.array();
export type DeviceList = z.infer<typeof deviceListSchema>;
+3 -3
View File
@@ -1,7 +1,7 @@
import {
HassEntity,
HassEntityAttributeBase,
HassEntityBase
HassEntity,
HassEntityAttributeBase,
HassEntityBase,
} from 'home-assistant-js-websocket';
const UPDATE_SUPPORT_PROGRESS = 4;
+1 -1
View File
@@ -4,4 +4,4 @@ These entity icon mappings are copied (with slight tweaks to work with this
card), from the [Lovelace Mushroom
Card](https://github.com/piitaya/lovelace-mushroom/tree/main/src/utils/icons), which are in turn copied from [the Home Assistant frontend](https://github.com/home-assistant/frontend/tree/dev/src/common/entity) in order to
replace the out of date entity icons in
[custom-card-helpers](https://github.com/custom-cards/custom-card-helpers).
[custom-card-helpers](https://github.com/custom-cards/custom-card-helpers).
+6 -1
View File
@@ -52,7 +52,12 @@ const FIXED_DOMAIN_ICONS = {
zone: 'mdi:map-marker-radius',
};
export function domainIcon(domain: string, entity?: HassEntity, state?: string, defaultIcon?: string): string {
export function domainIcon(
domain: string,
entity?: HassEntity,
state?: string,
defaultIcon?: string,
): string {
switch (domain) {
case 'alarm_control_panel':
return alarmPanelIcon(state);
+1 -4
View File
@@ -70,10 +70,7 @@ const batteryStateIcon = (
return batteryIcon(battery, batteryCharging);
};
const batteryIcon = (
batteryState: number | string,
batteryCharging?: boolean,
) => {
const batteryIcon = (batteryState: number | string, batteryCharging?: boolean) => {
const batteryValue = Number(batteryState);
if (isNaN(batteryValue)) {
if (batteryState === 'off') {
+2 -2
View File
@@ -62,7 +62,7 @@ export const changeViewToRecentEventsForCameraAndDependents = async (
targetView: options?.targetView,
select: options?.select,
useCache: options?.useCache,
viewContext: options?.viewContext
viewContext: options?.viewContext,
},
)
)?.dispatchChangeEvent(element);
@@ -201,7 +201,7 @@ export const executeMediaQueryForView = async (
camera: cameraID,
})
.mergeInContext(options?.viewContext)
.mergeInContext(viewerContext)
.mergeInContext(viewerContext);
};
export const executeMediaQueryForViewWithErrorDispatching = async (