|
| 1 | +DEFAULTS = { |
| 2 | + "label": "<span>\ud83e\ude78<span>{sgv}<span>{direction}</span>", |
| 3 | + "error_label": "<span>\ud83e\ude78</span>{error_message}", |
| 4 | + "tooltip": "({sgv_delta}) {delta_time_in_minutes} min", |
| 5 | + "host": "", |
| 6 | + "secret": "", |
| 7 | + "secret_env_name": "", |
| 8 | + "direction_icons": { |
| 9 | + "double_up": "\u2b06\ufe0f\u2b06\ufe0f", |
| 10 | + "single_up": "\u2b06\ufe0f", |
| 11 | + "forty_five_up": "\u2197\ufe0f", |
| 12 | + "flat": "\u27a1\ufe0f", |
| 13 | + "forty_five_down": "\u2198\ufe0f", |
| 14 | + "single_down": "\u2b07\ufe0f", |
| 15 | + "double_down": "\u2b07\ufe0f\u2b07\ufe0f", |
| 16 | + }, |
| 17 | + "sgv_measurement_units": "mg/dl", # "mg/dl" or "mmol/l" |
| 18 | + "callbacks": {"on_left": "open_cgm", "on_middle": "do_nothing", "on_right": "do_nothing"}, |
| 19 | + "notify_on_error": True, |
| 20 | +} |
| 21 | + |
| 22 | +VALIDATION_SCHEMA = { |
| 23 | + "label": { |
| 24 | + "type": "string", |
| 25 | + "required": False, |
| 26 | + "default": DEFAULTS["label"], |
| 27 | + }, |
| 28 | + "error_label": { |
| 29 | + "type": "string", |
| 30 | + "required": False, |
| 31 | + "default": DEFAULTS["error_label"], |
| 32 | + }, |
| 33 | + "tooltip": { |
| 34 | + "type": "string", |
| 35 | + "required": False, |
| 36 | + "default": DEFAULTS["tooltip"], |
| 37 | + }, |
| 38 | + "host": { |
| 39 | + "type": "string", |
| 40 | + "default": DEFAULTS["host"], |
| 41 | + }, |
| 42 | + "secret": { |
| 43 | + "type": "string", |
| 44 | + "default": DEFAULTS["secret"], |
| 45 | + }, |
| 46 | + "secret_env_name": { |
| 47 | + "type": "string", |
| 48 | + "required": False, |
| 49 | + "default": DEFAULTS["secret_env_name"], |
| 50 | + }, |
| 51 | + "direction_icons": { |
| 52 | + "type": "dict", |
| 53 | + "required": False, |
| 54 | + "schema": { |
| 55 | + "double_up": { |
| 56 | + "type": "string", |
| 57 | + "default": DEFAULTS["direction_icons"]["double_up"], |
| 58 | + }, |
| 59 | + "single_up": { |
| 60 | + "type": "string", |
| 61 | + "default": DEFAULTS["direction_icons"]["single_up"], |
| 62 | + }, |
| 63 | + "forty_five_up": { |
| 64 | + "type": "string", |
| 65 | + "default": DEFAULTS["direction_icons"]["forty_five_up"], |
| 66 | + }, |
| 67 | + "flat": { |
| 68 | + "type": "string", |
| 69 | + "default": DEFAULTS["direction_icons"]["flat"], |
| 70 | + }, |
| 71 | + "forty_five_down": { |
| 72 | + "type": "string", |
| 73 | + "default": DEFAULTS["direction_icons"]["forty_five_down"], |
| 74 | + }, |
| 75 | + "single_down": { |
| 76 | + "type": "string", |
| 77 | + "default": DEFAULTS["direction_icons"]["single_down"], |
| 78 | + }, |
| 79 | + "double_down": { |
| 80 | + "type": "string", |
| 81 | + "default": DEFAULTS["direction_icons"]["double_down"], |
| 82 | + }, |
| 83 | + }, |
| 84 | + "default": DEFAULTS["direction_icons"], |
| 85 | + }, |
| 86 | + "sgv_measurement_units": { |
| 87 | + "type": "string", |
| 88 | + "required": False, |
| 89 | + "default": DEFAULTS["sgv_measurement_units"], |
| 90 | + }, |
| 91 | + "callbacks": { |
| 92 | + "type": "dict", |
| 93 | + "schema": { |
| 94 | + "on_left": { |
| 95 | + "type": "string", |
| 96 | + "default": DEFAULTS["callbacks"]["on_left"], |
| 97 | + }, |
| 98 | + "on_middle": { |
| 99 | + "type": "string", |
| 100 | + "default": DEFAULTS["callbacks"]["on_middle"], |
| 101 | + }, |
| 102 | + "on_right": { |
| 103 | + "type": "string", |
| 104 | + "default": DEFAULTS["callbacks"]["on_right"], |
| 105 | + }, |
| 106 | + }, |
| 107 | + "default": DEFAULTS["callbacks"], |
| 108 | + }, |
| 109 | + "notify_on_error": { |
| 110 | + "type": "boolean", |
| 111 | + "required": False, |
| 112 | + "default": DEFAULTS["notify_on_error"], |
| 113 | + }, |
| 114 | + "label_shadow": { |
| 115 | + "type": "dict", |
| 116 | + "required": False, |
| 117 | + "schema": { |
| 118 | + "enabled": {"type": "boolean", "default": False}, |
| 119 | + "color": {"type": "string", "default": "black"}, |
| 120 | + "offset": {"type": "list", "default": [1, 1]}, |
| 121 | + "radius": {"type": "integer", "default": 3}, |
| 122 | + }, |
| 123 | + "default": {"enabled": False, "color": "black", "offset": [1, 1], "radius": 3}, |
| 124 | + }, |
| 125 | + "container_shadow": { |
| 126 | + "type": "dict", |
| 127 | + "required": False, |
| 128 | + "schema": { |
| 129 | + "enabled": {"type": "boolean", "default": False}, |
| 130 | + "color": {"type": "string", "default": "black"}, |
| 131 | + "offset": {"type": "list", "default": [1, 1]}, |
| 132 | + "radius": {"type": "integer", "default": 3}, |
| 133 | + }, |
| 134 | + "default": {"enabled": False, "color": "black", "offset": [1, 1], "radius": 3}, |
| 135 | + }, |
| 136 | +} |
0 commit comments