Bump prettier to v3 and format all files
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
HassEntity,
|
||||
HassEntityAttributeBase,
|
||||
HassEntityBase
|
||||
HassEntity,
|
||||
HassEntityAttributeBase,
|
||||
HassEntityBase,
|
||||
} from 'home-assistant-js-websocket';
|
||||
|
||||
const UPDATE_SUPPORT_PROGRESS = 4;
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user