diff --git a/reactive_home/src/composeables/useLightMapping.ts b/reactive_home/src/composeables/useLightMapping.ts index f18bf9b..10170b9 100644 --- a/reactive_home/src/composeables/useLightMapping.ts +++ b/reactive_home/src/composeables/useLightMapping.ts @@ -210,9 +210,11 @@ export type UseLightMappingOptions = { export function parseAutoEnableTimeFactory( input?: MaybeRef ) { + const defaultValue = 15 * 60 * 1000; + return computed(() => { if (!input) { - return 15 * 60 * 1000; + return defaultValue; } let value = unref(input); if (typeof value === "number") { @@ -221,7 +223,7 @@ export function parseAutoEnableTimeFactory( if (typeof value === "object") { value = value.state; } - return parse(value, "ms"); + return parse(value, "ms") ?? defaultValue; }); }