feat: Updated screensaver image mode fetches random images (#2430)
BREAKING CHANGE: The `screensaver` image mode now shows a random image from [picsum.photos](picsum.photos) instead of the embedded default image. If you previously set `image.mode: screensaver`, change it to `image.mode: default` to restore the previous behavior.
This commit is contained in:
committed by
dermotduffy
parent
9535bb8aa0
commit
e2cceb55c8
@@ -2,16 +2,25 @@ import { z } from 'zod';
|
||||
|
||||
export const imageBaseConfigDefault = {
|
||||
mode: 'auto' as const,
|
||||
refresh_seconds: 1,
|
||||
refresh_seconds: 'auto' as const,
|
||||
};
|
||||
|
||||
const IMAGE_MODES = ['auto', 'camera', 'entity', 'screensaver', 'url'] as const;
|
||||
const IMAGE_MODES = [
|
||||
'auto',
|
||||
'camera',
|
||||
'default',
|
||||
'entity',
|
||||
'screensaver',
|
||||
'url',
|
||||
] as const;
|
||||
export type ImageMode = (typeof IMAGE_MODES)[number];
|
||||
|
||||
export const imageBaseConfigSchema = z.object({
|
||||
mode: z.enum(IMAGE_MODES).default(imageBaseConfigDefault.mode),
|
||||
|
||||
refresh_seconds: z.number().min(0).default(imageBaseConfigDefault.refresh_seconds),
|
||||
refresh_seconds: z
|
||||
.union([z.literal('auto'), z.number().min(0)])
|
||||
.default(imageBaseConfigDefault.refresh_seconds),
|
||||
|
||||
url: z.string().optional(),
|
||||
entity: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user