diff --git a/assets/app/schema.json b/assets/app/schema.json index b9fbacc6..9e4f4f7f 100755 --- a/assets/app/schema.json +++ b/assets/app/schema.json @@ -10,9 +10,7 @@ }, { "type": "object", - "required": [ - "en" - ], + "required": ["en"], "patternProperties": { "^.*$": { "type": "string" @@ -35,9 +33,7 @@ "additionalProperties": false }, "author": { - "required": [ - "name" - ], + "required": ["name"], "properties": { "name": { "type": "string" @@ -51,10 +47,7 @@ } }, "images": { - "required": [ - "large", - "small" - ], + "required": ["large", "small"], "additionalProperties": false, "properties": { "large": { @@ -70,10 +63,7 @@ }, "flowCard": { "type": "object", - "required": [ - "id", - "title" - ], + "required": ["id", "title"], "properties": { "id": { "type": "string" @@ -86,54 +76,35 @@ }, "deprecated": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "advanced": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "platforms": { "type": "array", "uniqueItems": true, "items": { "type": "string", - "enum": [ - "cloud", - "local" - ] + "enum": ["cloud", "local"] } }, "droptoken": { "oneOf": [ { "type": "string", - "enum": [ - "boolean", - "number", - "string", - "image" - ] + "enum": ["boolean", "number", "string", "image"] }, { "type": "array", "items": { "type": "string", - "enum": [ - "boolean", - "number", - "string", - "image" - ] + "enum": ["boolean", "number", "string", "image"] } } ] @@ -142,22 +113,14 @@ "type": "array", "items": { "type": "object", - "required": [ - "name", - "title" - ], + "required": ["name", "title"], "properties": { "name": { "type": "string" }, "type": { "type": "string", - "enum": [ - "boolean", - "number", - "string", - "image" - ], + "enum": ["boolean", "number", "string", "image"], "default": "string" }, "title": { @@ -185,20 +148,14 @@ "anyOf": [ { "type": "object", - "required": [ - "name", - "type", - "filter" - ], + "required": ["name", "type", "filter"], "properties": { "name": { "type": "string" }, "type": { "type": "string", - "enum": [ - "device" - ] + "enum": ["device"] }, "filter": { "oneOf": [ @@ -214,10 +171,7 @@ }, { "type": "object", - "required": [ - "name", - "type" - ], + "required": ["name", "type"], "properties": { "title": { "$ref": "#/definitions/i18nObject" @@ -255,10 +209,7 @@ }, { "type": "object", - "required": [ - "name", - "type" - ], + "required": ["name", "type"], "properties": { "title": { "$ref": "#/definitions/i18nObject" @@ -268,10 +219,7 @@ }, "type": { "type": "string", - "enum": [ - "number", - "range" - ] + "enum": ["number", "range"] }, "min": { "type": "number" @@ -298,11 +246,7 @@ }, { "type": "object", - "required": [ - "name", - "type", - "values" - ], + "required": ["name", "type", "values"], "properties": { "title": { "$ref": "#/definitions/i18nObject" @@ -312,9 +256,7 @@ }, "type": { "type": "string", - "enum": [ - "dropdown" - ] + "enum": ["dropdown"] }, "values": { "type": "array", @@ -343,20 +285,11 @@ "oneOf": [ { "type": "object", - "required": [ - "id", - "type", - "title" - ], + "required": ["id", "type", "title"], "properties": { "type": { "type": "string", - "enum": [ - "text", - "password", - "textarea", - "label" - ] + "enum": ["text", "password", "textarea", "label"] }, "id": { "type": "string" @@ -377,18 +310,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "title" - ], + "required": ["id", "type", "title"], "properties": { "type": { "type": "string", - "enum": [ - "number", - "slider" - ] + "enum": ["number", "slider"] }, "id": { "type": "string" @@ -419,19 +345,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "title", - "values" - ], + "required": ["id", "type", "title", "values"], "properties": { "type": { "type": "string", - "enum": [ - "radio", - "dropdown" - ] + "enum": ["radio", "dropdown"] }, "id": { "type": "string" @@ -449,10 +367,7 @@ "type": "array", "items": { "type": "object", - "required": [ - "id", - "title" - ], + "required": ["id", "title"], "properties": { "id": { "type": "string" @@ -467,17 +382,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "title" - ], + "required": ["id", "type", "title"], "properties": { "type": { "type": "string", - "enum": [ - "checkbox" - ] + "enum": ["checkbox"] }, "id": { "type": "string" @@ -495,17 +404,11 @@ }, { "type": "object", - "required": [ - "type", - "title", - "children" - ], + "required": ["type", "title", "children"], "properties": { "type": { "type": "string", - "enum": [ - "group" - ] + "enum": ["group"] }, "title": { "$ref": "#/definitions/i18nObject" @@ -524,20 +427,11 @@ "oneOf": [ { "type": "object", - "required": [ - "id", - "type", - "label" - ], + "required": ["id", "type", "label"], "properties": { "type": { "type": "string", - "enum": [ - "text", - "password", - "textarea", - "label" - ] + "enum": ["text", "password", "textarea", "label"] }, "id": { "oneOf": [ @@ -563,9 +457,7 @@ }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "zwave": { "$ref": "#/definitions/zwaveSetting" @@ -574,18 +466,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "label" - ], + "required": ["id", "type", "label"], "properties": { "type": { "type": "string", - "enum": [ - "number", - "slider" - ] + "enum": ["number", "slider"] }, "id": { "oneOf": [ @@ -636,9 +521,7 @@ }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "zwave": { "$ref": "#/definitions/zwaveSetting" @@ -647,19 +530,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "label", - "values" - ], + "required": ["id", "type", "label", "values"], "properties": { "type": { "type": "string", - "enum": [ - "radio", - "dropdown" - ] + "enum": ["radio", "dropdown"] }, "id": { "oneOf": [ @@ -684,10 +559,7 @@ "type": "array", "items": { "type": "object", - "required": [ - "id", - "label" - ], + "required": ["id", "label"], "properties": { "id": { "type": "string" @@ -700,9 +572,7 @@ }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "zwave": { "$ref": "#/definitions/zwaveSetting" @@ -711,17 +581,11 @@ }, { "type": "object", - "required": [ - "id", - "type", - "label" - ], + "required": ["id", "type", "label"], "properties": { "type": { "type": "string", - "enum": [ - "checkbox" - ] + "enum": ["checkbox"] }, "id": { "oneOf": [ @@ -744,9 +608,7 @@ }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "zwave": { "$ref": "#/definitions/zwaveSetting" @@ -755,17 +617,11 @@ }, { "type": "object", - "required": [ - "type", - "label", - "children" - ], + "required": ["type", "label", "children"], "properties": { "type": { "type": "string", - "enum": [ - "group" - ] + "enum": ["group"] }, "label": { "$ref": "#/definitions/i18nObject" @@ -775,9 +631,7 @@ }, "highlight": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "zwave": { "$ref": "#/definitions/zwaveSetting" @@ -789,10 +643,7 @@ }, "matterDevice": { "type": "object", - "required": [ - "vendorId", - "productId" - ], + "required": ["vendorId", "productId"], "properties": { "vendorId": { "oneOf": [ @@ -864,9 +715,7 @@ }, "learnmode": { "type": "object", - "required": [ - "instruction" - ], + "required": ["instruction"], "properties": { "image": { "type": "string" @@ -880,11 +729,7 @@ }, "zigbeeDevice": { "type": "object", - "required": [ - "manufacturerName", - "productId", - "endpoints" - ], + "required": ["manufacturerName", "productId", "endpoints"], "properties": { "manufacturerName": { "oneOf": [ @@ -939,9 +784,7 @@ }, "learnmode": { "type": "object", - "required": [ - "instruction" - ], + "required": ["instruction"], "properties": { "image": { "type": "string" @@ -955,11 +798,7 @@ }, "zwaveDevice": { "type": "object", - "required": [ - "manufacturerId", - "productTypeId", - "productId" - ], + "required": ["manufacturerId", "productTypeId", "productId"], "properties": { "manufacturerId": { "oneOf": [ @@ -1002,9 +841,7 @@ }, "learnmode": { "type": "object", - "required": [ - "instruction" - ], + "required": ["instruction"], "properties": { "image": { "type": "string" @@ -1041,22 +878,14 @@ "type": "array", "items": { "type": "object", - "required": [ - "id", - "size", - "value" - ], + "required": ["id", "size", "value"], "properties": { "id": { "type": "number" }, "size": { "type": "number", - "enum": [ - 1, - 2, - 4 - ] + "enum": [1, 2, 4] }, "value": { "oneOf": [ @@ -1072,11 +901,7 @@ "type": "object", "items": { "type": "object", - "required": [ - "class", - "capabilities", - "name" - ], + "required": ["class", "capabilities", "name"], "properties": { "class": { "type": "string" @@ -1103,21 +928,14 @@ }, "zwaveSetting": { "type": "object", - "required": [ - "index", - "size" - ], + "required": ["index", "size"], "properties": { "index": { "type": "number" }, "size": { "type": "number", - "enum": [ - 1, - 2, - 4 - ] + "enum": [1, 2, 4] }, "signed": { "type": "boolean" @@ -1125,13 +943,7 @@ } } }, - "required": [ - "id", - "name", - "version", - "compatibility", - "author" - ], + "required": ["id", "name", "version", "compatibility", "author"], "properties": { "id": { "type": "string" @@ -1164,22 +976,14 @@ "type": "array", "items": { "type": "string", - "enum": [ - "cloud", - "local" - ] + "enum": ["cloud", "local"] } }, "platformLocalRequiredFeatures": { "type": "array", "items": { "type": "string", - "enum": [ - "nfc", - "speaker", - "ledring", - "matter" - ] + "enum": ["nfc", "speaker", "ledring", "matter"] } }, "tags": { @@ -1322,12 +1126,7 @@ "type": "array", "items": { "type": "object", - "required": [ - "id", - "name", - "class", - "capabilities" - ], + "required": ["id", "name", "class", "capabilities"], "properties": { "id": { "type": "string" @@ -1353,9 +1152,7 @@ }, "deprecated": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "discovery": { "type": "string" @@ -1366,10 +1163,7 @@ "approximation": { "oneOf": [ { - "required": [ - "usageOn", - "usageOff" - ], + "required": ["usageOn", "usageOff"], "additionalProperties": false, "properties": { "usageOn": { @@ -1381,9 +1175,7 @@ } }, { - "required": [ - "usageConstant" - ], + "required": ["usageConstant"], "additionalProperties": false, "properties": { "usageConstant": { @@ -1395,9 +1187,7 @@ }, "cumulative": { "type": "boolean", - "enum": [ - true - ] + "enum": [true] }, "cumulativeImportedCapability": { "type": "string" @@ -1418,9 +1208,7 @@ "type": "array", "items": { "type": "object", - "required": [ - "id" - ], + "required": ["id"], "properties": { "id": { "type": "string" @@ -1492,10 +1280,7 @@ "uniqueItems": true, "items": { "type": "string", - "enum": [ - "cloud", - "local" - ] + "enum": ["cloud", "local"] } }, "connectivity": { @@ -1562,18 +1347,12 @@ "patternProperties": { "^.*$": { "type": "object", - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": false, "properties": { "type": { "type": "string", - "enum": [ - "mdns-sd", - "ssdp", - "mac" - ] + "enum": ["mdns-sd", "ssdp", "mac"] }, "id": { "type": "string", @@ -1585,10 +1364,7 @@ "type": "array", "items": { "type": "object", - "required": [ - "field", - "match" - ], + "required": ["field", "match"], "additionalProperties": false, "properties": { "field": { @@ -1596,18 +1372,12 @@ }, "match": { "type": "object", - "required": [ - "type", - "value" - ], + "required": ["type", "value"], "additionalProperties": false, "properties": { "type": { "type": "string", - "enum": [ - "string", - "regex" - ] + "enum": ["string", "regex"] }, "value": { "type": "string" @@ -1620,10 +1390,7 @@ }, "mdns-sd": { "type": "object", - "required": [ - "name", - "protocol" - ], + "required": ["name", "protocol"], "additionalProperties": false, "properties": { "name": { @@ -1632,18 +1399,13 @@ }, "protocol": { "type": "string", - "enum": [ - "tcp", - "udp" - ] + "enum": ["tcp", "udp"] } } }, "ssdp": { "type": "object", - "required": [ - "search" - ], + "required": ["search"], "additionalProperties": false, "properties": { "search": { @@ -1654,9 +1416,7 @@ }, "mac": { "type": "object", - "required": [ - "manufacturer" - ], + "required": ["manufacturer"], "additionalProperties": false, "properties": { "manufacturer": { @@ -1681,8 +1441,65 @@ } } }, + "widgets": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/i18nObject" + }, + "height": { + "type": ["number", "string"] + }, + "transparent": { + "type": "boolean" + }, + "settings": { + "type": "array" + }, + "devices": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["global", "app"] }, + "singular": { "type": "boolean" }, + "filter": { + "type": "object", + "properties": { + "class": { "type": "string" }, + "capabilities": { "type": "string" } + } + } + }, + "required": ["type", "singular"] + }, + "api": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "method": { + "type": "string", + "enum": ["GET", "POST", "PUT", "DELETE"] + }, + "path": { "type": "string" } + }, + "required": ["method", "path"] + } + } + }, + "id": { "type": "string" }, + "deprecated": { "type": "boolean" } + }, + "required": ["name", "id"] + } + }, + "additionalProperties": false + }, "settings": { "$ref": "#/definitions/appSettings" } } -} \ No newline at end of file +} diff --git a/assets/capability/capabilities/light_hue.json b/assets/capability/capabilities/light_hue.json index b5c0e277..d34abc05 100755 --- a/assets/capability/capabilities/light_hue.json +++ b/assets/capability/capabilities/light_hue.json @@ -37,14 +37,14 @@ "da": "Indstil farvetonen", "ru": "Установить оттенок", "pl": "Ustaw odcień", - "ko": "색상 설정" + "ko": "색조 설정" }, "hint": { "en": "Select a color from the hue scale, for example red (0°/360°), yellow (60°), or blue (180°).", "nl": "Selecteer een kleurtint van de hue schaal, bijvoorbeeld rood (0°/360°), geel (60°), of blauw (180°).", "ru": "Выберите цвет из шкалы оттенков, например красный (0°/360°), желтый (60°) или синий (180°).", "pl": "Wybierz barwę ze skali odcieni: np. czerwień (0°/360°), żółty (60°) lub niebieski (180°).", - "ko": "색상 스케일에서 색상을 선택하세요. 빨간색은 (0°/360°), 노란색은 (60°), 파란색은 (180°)이에요.", + "ko": "색조 스케일에서 색상을 선택하세요. 빨간색은 (0°/360°), 노란색은 (60°), 파란색은 (180°)이에요.", "no": "Velg en farge fra fargeskalaen, for eksempel rød (0°/360°), gul (60°) eller blå (180°)." }, "args": [ diff --git a/generated_locales/da.json b/generated_locales/da.json index 123a27f9..2192d145 100644 --- a/generated_locales/da.json +++ b/generated_locales/da.json @@ -1109,4 +1109,4 @@ "./assets/device/classes/windowcoverings.json@title": "Vinduesdække", "./assets/device/classes/windowcoverings.json@description": "Brug denne enhedsklasse til vinduesdække, når enhedsklasserne `curtains`, `blinds` og `sunshade` ikke er gældende.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Hvad er typen?" -} +} \ No newline at end of file diff --git a/generated_locales/de.json b/generated_locales/de.json index c7b0f08b..6cfe9177 100644 --- a/generated_locales/de.json +++ b/generated_locales/de.json @@ -511,4 +511,4 @@ "./assets/device/classes/windowcoverings.json@title": "Fenster-Abdeckungen", "./assets/device/classes/windowcoverings.json@description": "Nutze diese Geräteklasse für Fenster-Abdeckungen, wenn `curtains`-, `blinds`- oder `sunshade`-Geräteklassen nicht zutreffen.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Um welchen Typ handelt es sich?" -} +} \ No newline at end of file diff --git a/generated_locales/en.json b/generated_locales/en.json index b7caee00..52e3997f 100644 --- a/generated_locales/en.json +++ b/generated_locales/en.json @@ -1147,4 +1147,4 @@ "./assets/device/classes/windowcoverings.json@title": "Window Coverings", "./assets/device/classes/windowcoverings.json@description": "Use this device class for window coverings, when the `curtains`, `blinds` or `sunshade` device class doesn't apply.", "./assets/device/classes/windowcoverings.json@virtualTitle": "What's the type?" -} +} \ No newline at end of file diff --git a/generated_locales/es.json b/generated_locales/es.json index 60d012b2..387b3e50 100644 --- a/generated_locales/es.json +++ b/generated_locales/es.json @@ -1112,4 +1112,4 @@ "./assets/device/classes/windowcoverings.json@title": "Cobertores de ventanas", "./assets/device/classes/windowcoverings.json@description": "Utiliza esta clase de dispositivo para los cobertores de ventanas que no entren en las clases `curtains`, `blinds` o `sunshade`.", "./assets/device/classes/windowcoverings.json@virtualTitle": "¿Cuál es el tipo?" -} +} \ No newline at end of file diff --git a/generated_locales/fr.json b/generated_locales/fr.json index c511b559..b5b8d90a 100644 --- a/generated_locales/fr.json +++ b/generated_locales/fr.json @@ -1109,4 +1109,4 @@ "./assets/device/classes/windowcoverings.json@title": "Couverture de fenêtre", "./assets/device/classes/windowcoverings.json@description": "Utilisez cette classe d'appareil pour les couvertures de fenêtre, lorsque la classe d'appareil `curtains`, `blinds` ou `sunshade` ne s'applique pas.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Quel est le type ?" -} +} \ No newline at end of file diff --git a/generated_locales/it.json b/generated_locales/it.json index cf7bfa09..ad3ed3ca 100644 --- a/generated_locales/it.json +++ b/generated_locales/it.json @@ -1107,4 +1107,4 @@ "./assets/device/classes/windowcoverings.json@title": "Rivestimenti per finestre", "./assets/device/classes/windowcoverings.json@description": "Utilizza questa classe di dispositivi per i rivestimenti per finestre, quando non rientrano nelle classi `curtains`, `blinds` o `sunshade`.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Qual è il tipo?" -} +} \ No newline at end of file diff --git a/generated_locales/ko.json b/generated_locales/ko.json index 0d3a0dfe..402af27a 100644 --- a/generated_locales/ko.json +++ b/generated_locales/ko.json @@ -530,8 +530,8 @@ "./assets/capability/capabilities/level_tvoc.json@$flow.triggers.0.title": "총휘발성유기화합물 수준이 다음으로 변경되면", "./assets/capability/capabilities/level_tvoc.json@$flow.conditions.0.title": "총휘발성유기화합물 수준이 다음!{{이면|이 아니면}}", "./assets/capability/capabilities/light_hue.json@title": "색상", - "./assets/capability/capabilities/light_hue.json@$flow.actions.0.title": "색상 설정", - "./assets/capability/capabilities/light_hue.json@$flow.actions.0.hint": "색상 스케일에서 색상을 선택하세요. 빨간색은 (0°/360°), 노란색은 (60°), 파란색은 (180°)이에요.", + "./assets/capability/capabilities/light_hue.json@$flow.actions.0.title": "색조 설정", + "./assets/capability/capabilities/light_hue.json@$flow.actions.0.hint": "색조 스케일에서 색상을 선택하세요. 빨간색은 (0°/360°), 노란색은 (60°), 파란색은 (180°)이에요.", "./assets/capability/capabilities/light_hue.json@$flow.actions.1.title": "색상 설정", "./assets/capability/capabilities/light_hue.json@$flow.actions.2.title": "무작위 색상 설정", "./assets/capability/capabilities/light_mode.json@title": "라이트 모드", @@ -1147,4 +1147,4 @@ "./assets/device/classes/windowcoverings.json@title": "창문 커버", "./assets/device/classes/windowcoverings.json@description": "이 디바이스 클래스는 'curtains', 'blinds', 'sunshade' 디바이스 클래스가 적용되지 않는 창문 덮개에 사용합니다.", "./assets/device/classes/windowcoverings.json@virtualTitle": "어떤 유형인가요?" -} +} \ No newline at end of file diff --git a/generated_locales/nl.json b/generated_locales/nl.json index d361a4e5..f4b67e57 100644 --- a/generated_locales/nl.json +++ b/generated_locales/nl.json @@ -1084,4 +1084,4 @@ "./assets/device/classes/watervalve.json@description": "Gebruik deze apparaatklasse voor mechanische waterkleppen.", "./assets/device/classes/windowcoverings.json@title": "Raambekleding", "./assets/device/classes/windowcoverings.json@virtualTitle": "Wat voor type is dit?" -} +} \ No newline at end of file diff --git a/generated_locales/no.json b/generated_locales/no.json index 0d54c03a..11dd4674 100644 --- a/generated_locales/no.json +++ b/generated_locales/no.json @@ -1144,4 +1144,4 @@ "./assets/device/classes/windowcoverings.json@title": "Vindusbeskyttelse", "./assets/device/classes/windowcoverings.json@description": "Bruk denne enhetsklassen for vindusskjerming som ikke dekkes av enhetsklassene «gardiner», «persienner» eller «markise».", "./assets/device/classes/windowcoverings.json@virtualTitle": "Hvilken type er det?" -} +} \ No newline at end of file diff --git a/generated_locales/pl.json b/generated_locales/pl.json index 05aa23f8..5c7de50d 100644 --- a/generated_locales/pl.json +++ b/generated_locales/pl.json @@ -1119,4 +1119,4 @@ "./assets/device/classes/windowcoverings.json@title": "Osłony okienne", "./assets/device/classes/windowcoverings.json@description": "Użyj tej klasy urządzeń dla osłon okiennych o innej klasie urządzenia niż `curtains`, `blinds` lub `sunshade`.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Wybierz rodzaj?" -} +} \ No newline at end of file diff --git a/generated_locales/ru.json b/generated_locales/ru.json index 08673891..3be683d0 100644 --- a/generated_locales/ru.json +++ b/generated_locales/ru.json @@ -1147,4 +1147,4 @@ "./assets/device/classes/windowcoverings.json@title": "Оконные навесы", "./assets/device/classes/windowcoverings.json@description": "Используйте этот класс устройств для оконных навесов, когда классы устройств `curtains`, `blinds` или `sunshade` не подходят.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Какой тип?" -} +} \ No newline at end of file diff --git a/generated_locales/sv.json b/generated_locales/sv.json index d94716b8..bedd9b91 100644 --- a/generated_locales/sv.json +++ b/generated_locales/sv.json @@ -1104,4 +1104,4 @@ "./assets/device/classes/windowcoverings.json@title": "Fönsterskydd", "./assets/device/classes/windowcoverings.json@description": "Använd den här enhetsklassen för fönsterskydd när enhetsklasserna `curtains`, `blinds` eller `sunshade` inte gäller.", "./assets/device/classes/windowcoverings.json@virtualTitle": "Vad är det för typ?" -} +} \ No newline at end of file diff --git a/lib/App/index.js b/lib/App/index.js index 354df4f5..66fe5228 100644 --- a/lib/App/index.js +++ b/lib/App/index.js @@ -165,6 +165,21 @@ class App { } for (const [widgetId, widget] of Object.entries(appJson.widgets)) { + if (widget.transparent !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.1.0')) { + throw new Error(`App widgets transparent property requires a compatibility of at least >=12.1.0. (${this._path})`); + } + + if (widget.deprecated !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) { + throw new Error(`App widgets deprecated property requires a compatibility of at least >=12.3.0. (${this._path})`); + } + + if (widget.devices !== undefined && semver.lt(semver.coerce(appJson.compatibility), '12.3.0')) { + throw new Error(`App widgets devices property requires a compatibility of at least >=12.3.0. (${this._path})`); + } + + // if widget.devices && widget.devices.type === 'global' + // require api permission which the app already propbably has + const apiFilePathMjs = join(this._path, 'widgets', widget.id, 'api.mjs'); const apiFilePathCjs = join(this._path, 'widgets', widget.id, 'api.cjs'); @@ -434,10 +449,10 @@ class App { if (driver.energy.cumulative === true) { if (typeof driver.energy.cumulativeImportedCapability !== 'string') { - console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeImportedCapability'.`); + console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeImportedCapability'. Disregard this warning if the driver does not have \`meter_power\` capabilities.`); } if (typeof driver.energy.cumulativeExportedCapability !== 'string') { - console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeExportedCapability'.`); + console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeExportedCapability'. Disregard this warning if the driver does not have \`meter_power\` capabilities.`); } if (typeof driver.energy.cumulativeImportedCapability === 'string' && Capability.isInstanceOfId(driver.energy.cumulativeImportedCapability, 'meter_power') === false) { throw new Error(`drivers.${driver.id} has 'cumulativeImportedCapability': '${driver.energy.cumulativeImportedCapability}' but only instances of 'meter_power' are allowed.`);