Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdim #517

Merged
merged 10 commits into from
Dec 23, 2024
451 changes: 134 additions & 317 deletions assets/app/schema.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/capability/capabilities/light_hue.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion generated_locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
6 changes: 3 additions & 3 deletions generated_locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "라이트 모드",
Expand Down Expand Up @@ -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": "어떤 유형인가요?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Какой тип?"
}
}
2 changes: 1 addition & 1 deletion generated_locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
}
}
19 changes: 17 additions & 2 deletions lib/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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.`);
Expand Down
Loading