diff --git a/src/config/types.ts b/src/config/types.ts index 54c292fd..d7711efa 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -116,15 +116,6 @@ export type ViewDisplayConfig = z.infer; // Stock Actions // ************************************************************************* -// Declare schemas for existing types. -// See: https://github.com/colinhacks/zod/issues/372#issuecomment-826380330 -const schemaForType = - () => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - >(arg: S) => { - return arg; - }; - // https://www.home-assistant.io/dashboards/actions/#options-for-confirmation const actionBaseSchema = z.object({ confirmation: z @@ -153,15 +144,13 @@ const toggleActionSchema = actionBaseSchema.extend({ }); export type ToggleActionConfig = z.infer; -const targetSchema = schemaForType()( - z.object({ - entity_id: z.string().or(z.string().array()).optional(), - device_id: z.string().or(z.string().array()).optional(), - area_id: z.string().or(z.string().array()).optional(), - floor_id: z.string().or(z.string().array()).optional(), - label_id: z.string().or(z.string().array()).optional(), - }), -); +const targetSchema: z.ZodSchema = z.object({ + entity_id: z.string().or(z.string().array()).optional(), + device_id: z.string().or(z.string().array()).optional(), + area_id: z.string().or(z.string().array()).optional(), + floor_id: z.string().or(z.string().array()).optional(), + label_id: z.string().or(z.string().array()).optional(), +}); const performActionActionSchema = actionBaseSchema.extend({ action: z.literal('perform-action'),