From 41af86348433505c4e1b2ee7165465d9c9751636 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Thu, 25 Feb 2021 10:58:51 +0100 Subject: [PATCH] Update projector_countdown --- docs/datavalidator/check_json.py | 6 ++++++ docs/models.yml | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/datavalidator/check_json.py b/docs/datavalidator/check_json.py index 8769cc614..bd8ee7d67 100644 --- a/docs/datavalidator/check_json.py +++ b/docs/datavalidator/check_json.py @@ -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"): diff --git a/docs/models.yml b/docs/models.yml index 64abeb7e1..57adc490a 100644 --- a/docs/models.yml +++ b/docs/models.yml @@ -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