Update projector_countdown

This commit is contained in:
Finn Stutzenstein 2021-02-25 10:58:51 +01:00
parent 36125dadc5
commit 41af863484
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
2 changed files with 21 additions and 5 deletions

View File

@ -51,6 +51,10 @@ def check_number(value: Any) -> bool:
return value is None or isinstance(value, int)
def check_float(value: Any) -> bool:
return value is None or isinstance(value, int) or isinstance(value, float)
def check_boolean(value: Any) -> bool:
return value is None or value is False or value is True
@ -156,6 +160,8 @@ class Checker:
checker = check_string
elif field_type in ("number", "timestamp", "relation"):
checker = check_number
elif field_type == "float":
checker = check_float
elif field_type == "boolean":
checker = check_boolean
elif field_type in ("string[]", "generic-relation-list"):

View File

@ -2046,11 +2046,21 @@ projector_message:
projector_countdown:
id: number
title: string
description: string
default_time: number
countdown_time: number # float?
running: boolean
title:
type: string
required: true
description:
type: string
default: ""
default_time:
type: number
default: 60
countdown_time:
type: float
default: 60
running:
type: boolean
default: false
projection_ids:
type: relation-list