diff --git a/@types/my-extensions/homey-lib.d.ts b/@types/my-extensions/homey-lib.d.ts new file mode 100644 index 0000000..c8fbdd8 --- /dev/null +++ b/@types/my-extensions/homey-lib.d.ts @@ -0,0 +1,96 @@ +declare module 'homey-lib' { + interface ITranslationObject { + en: string; + nl: string; + de: string; + fr: string; + it: string; + sv: string; + no: string; + es: string; + da: string; + ru: string; + pl: string; + ko: string; + [key: string]: string; + } + + interface IDeviceClass { + title: ITranslationObject; + description: ITranslationObject; + virtualTitle?: ITranslationObject; + minCompatibility?: string; + virtualTitle?: ITranslationObject; + allowedVirtual?: string[]; + } + + interface ICapability { + title: ITranslationObject; + desc?: ITranslationObject; + type: string; + gettable: boolean + settable: boolean; + insights?: boolean; + insightsTitleTrue?: ITranslationObject; + insightsTitleFalse?: ITranslationObject; + uiComponent: string; + minCompatibility?: string; + } + + interface IDeviceClasses { + [key: string]: IDeviceClass; + } + + interface ICapabilities { + [key: string]: ICapability; + } + + export class HomeyLib { + static getLocales(): unknown; + static getCategories(): unknown; + static getPermissions(): unknown; + static getBrandColor(): unknown; + } + + export class Device { + static getClasses(): IDeviceClasses; + static getClass(id: string): IDeviceClass; + static getCapabilities(): ICapability; + } + + export class Capability { + static getCapabilities(): ICapabilities; + static getCapability(id: string): ICapability; + static hasCapability(id: string): boolean; + } + + export class Signal { + // Define Signal class methods and properties if available + } + + export class Media { + static getCodecs(): unknown; + } + + export class Energy { + static getCurrencies(): unknown; + static getBatteries(): unknown; + } + + export function getDeviceClasses(): Record; + export function getDeviceClass(id: string): unknown; + + export function getCapabilities(): unknown; + export function getCapability(id: string): unknown; + export function hasCapability(id: string): boolean; + + export function getAppLocales(): unknown; + export function getAppCategories(): unknown; + export function getAppPermissions(): unknown; + export function getAppBrandColor(): unknown; + + export function getMediaCodecs(): unknown; + + export function getCurrencies(): unknown; + export function getBatteries(): unknown; +} \ No newline at end of file diff --git a/app.ts b/app.ts index 0742852..cae9101 100644 --- a/app.ts +++ b/app.ts @@ -7,6 +7,7 @@ import ConditionCardEvaluateSensorCapabilities from './lib/ConditionCardEvaluate import ConditionCardZoneActiveForMinutes from './lib/ConditionCardZoneActiveForMinutes'; import TriggerCardAnyDeviceTurnedOn from './lib/TriggerCardAnyDeviceOnOff'; import ZonesDb from './lib/ZonesDb'; +import HomeyLib from 'homey-lib'; class ZoneActivity extends Homey.App { /** diff --git a/lib/ConditionCardAnyDeviceTurnedOn.ts b/lib/ConditionCardAnyDeviceTurnedOn.ts index a361d31..5c58580 100644 --- a/lib/ConditionCardAnyDeviceTurnedOn.ts +++ b/lib/ConditionCardAnyDeviceTurnedOn.ts @@ -1,12 +1,12 @@ import { ExtendedHomeyAPIV3Local } from "homey-api"; import Homey from "homey/lib/Homey"; -import { DeviceClassManager } from "./DeviceClassManager"; import { FlowCard, FlowCardCondition } from "homey"; import handleZoneAutocomplete from "../utils/handleZoneAutocomplete"; import ZonesDb from "./ZonesDb"; +import HomeyLib from "homey-lib"; export default class ConditionCardAnyDeviceTurnedOn { - + private static instance: ConditionCardAnyDeviceTurnedOn | null = null; conditionCard: FlowCardCondition; @@ -27,17 +27,18 @@ export default class ConditionCardAnyDeviceTurnedOn { this.conditionCard.registerArgumentAutocompleteListener('zone', async (query: string) => await handleZoneAutocomplete(query, this.zonesDb)); this.conditionCard.registerArgumentAutocompleteListener('deviceType', async (query: string): Promise => { - const deviceClasses = DeviceClassManager.getAllDeviceClasses(); + const deviceClasses = HomeyLib.Device.getClasses(); const results = [{ name: this.homey.__('any_type') ?? "Any type", id: 'any_type', }]; - results.push(...Object.values(deviceClasses).map((deviceClass) => { + const languageCode = this.homey.i18n.getLanguage(); + results.push(...Object.entries(deviceClasses).map(([key, deviceClass]) => { return { - name: this.homey.__(deviceClass.id) ?? deviceClass.friendlyName, - id: deviceClass.id, + name: deviceClass.title[languageCode], + id: key, }; })); @@ -53,7 +54,7 @@ export default class ConditionCardAnyDeviceTurnedOn { try { this.conditionCard.registerRunListener(async (args, _state) => { this.log(`Checking devices in zone '${args.zone.id}' with class '${args.deviceType.id}'.`); - + const zone = await this.zonesDb.getZone(args.zone.id); if (zone == null) diff --git a/lib/ConditionCardEvaluateSensorCapabilities.ts b/lib/ConditionCardEvaluateSensorCapabilities.ts index ea5b755..a840018 100644 --- a/lib/ConditionCardEvaluateSensorCapabilities.ts +++ b/lib/ConditionCardEvaluateSensorCapabilities.ts @@ -1,9 +1,9 @@ import { FlowCard, FlowCardCondition } from "homey"; import { ExtendedHomeyAPIV3Local } from "homey-api"; import Homey from "homey/lib/Homey"; -import { SensorCapabilitiesManager } from "./SensorCapabilitiesManager"; import handleZoneAutocomplete from "../utils/handleZoneAutocomplete"; import ZonesDb from "./ZonesDb"; +import HomeyLib from "homey-lib"; export default class ConditionCardEvaluateSensorCapabilities { private static instance: ConditionCardEvaluateSensorCapabilities | null = null; @@ -16,7 +16,7 @@ export default class ConditionCardEvaluateSensorCapabilities { public static async initialize(homey: Homey, homeyApi: ExtendedHomeyAPIV3Local, zonesDb: ZonesDb, log: (...args: unknown[]) => void): Promise { if (ConditionCardEvaluateSensorCapabilities.instance === null) { ConditionCardEvaluateSensorCapabilities.instance = new ConditionCardEvaluateSensorCapabilities(homey, homeyApi, zonesDb, log); - await ConditionCardEvaluateSensorCapabilities.instance; + await ConditionCardEvaluateSensorCapabilities.instance.setup(); } } @@ -25,14 +25,19 @@ export default class ConditionCardEvaluateSensorCapabilities { this.conditionCard.registerArgumentAutocompleteListener('zone', async (query: string) => await handleZoneAutocomplete(query, this.zonesDb)); this.conditionCard.registerArgumentAutocompleteListener('capability', async (query: string): Promise => { - const deviceClasses = SensorCapabilitiesManager.getAllSensorCapabilities(); - const results = [...Object.values(deviceClasses).map((capability) => { - return { - name: this.homey.__(capability.id) ?? capability.friendlyName, - id: capability.id, - }; - })]; + const capabilities = HomeyLib.Capability.getCapabilities(); + + const languageCode = this.homey.i18n.getLanguage(); + const results = [...Object.entries(capabilities) + .filter(([_key, capability]) => capability.uiComponent === 'sensor') + .map(([key, capability]) => { + return { + name: capability.title[languageCode], + description: capability.desc?.[languageCode], + id: key, + }; + })]; return results.filter((result) => { return result.name.toLowerCase().includes(query.toLowerCase()); @@ -79,23 +84,23 @@ export default class ConditionCardEvaluateSensorCapabilities { return devicesToCheck.some(device => { const value = device.capabilitiesObj[capability].value as number; switch (equation) { - case 'equals': { - const result = value === otherValue; - this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'equal' : 'not equal'} to '${otherValue}'.`, { device: device.name, args }); - return result; - } - case 'is-greater-than': { - const result = value > otherValue; - this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'greater' : 'not greater'} than '${otherValue}'.`, { device: device.name, args }); - return result; - } - case 'is-less-than': { - const result = value < otherValue; - this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'less' : 'not less'} than '${otherValue}'.`, { device: device.name, args }); - return result; - } - default: - throw new Error(`Unknown equation '${equation}'.`); + case 'equals': { + const result = value === otherValue; + this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'equal' : 'not equal'} to '${otherValue}'.`, { device: device.name, args }); + return result; + } + case 'is-greater-than': { + const result = value > otherValue; + this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'greater' : 'not greater'} than '${otherValue}'.`, { device: device.name, args }); + return result; + } + case 'is-less-than': { + const result = value < otherValue; + this.log(`Device '${device.name}' has value '${value}' for capability '${capability}' which is ${result ? 'less' : 'not less'} than '${otherValue}'.`, { device: device.name, args }); + return result; + } + default: + throw new Error(`Unknown equation '${equation}'.`); } }); diff --git a/lib/DeviceClassManager.ts b/lib/DeviceClassManager.ts deleted file mode 100644 index e6e06a1..0000000 --- a/lib/DeviceClassManager.ts +++ /dev/null @@ -1,304 +0,0 @@ -type DeviceClass = { - id: string; - friendlyName: string; -} - -export class DeviceClassManager { - - static readonly deviceClasses: { - [key: string]: DeviceClass; - } = { - amplifier: { - id: "amplifier", - friendlyName: "Amplifier" - }, - blinds: { - id: "blinds", - friendlyName: "Blinds" - }, - button: { - id: "button", - friendlyName: "Button" - }, - camera: { - id: "camera", - friendlyName: "Camera" - }, - coffeemachine: { - id: "coffeemachine", - friendlyName: "Coffee Machine" - }, - curtain: { - id: "curtain", - friendlyName: "Curtain" - }, - doorbell: { - id: "doorbell", - friendlyName: "Doorbell" - }, - fan: { - id: "fan", - friendlyName: "Fan" - }, - garagedoor: { - id: "garagedoor", - friendlyName: "Garage Door" - }, - heater: { - id: "heater", - friendlyName: "Heater" - }, - homealarm: { - id: "homealarm", - friendlyName: "Home Alarm" - }, - kettle: { - id: "kettle", - friendlyName: "Kettle" - }, - light: { - id: "light", - friendlyName: "Light" - }, - lock: { - id: "lock", - friendlyName: "Lock" - }, - other: { - id: "other", - friendlyName: "Other" - }, - remote: { - id: "remote", - friendlyName: "Remote" - }, - sensor: { - id: "sensor", - friendlyName: "Sensor" - }, - socket: { - id: "socket", - friendlyName: "Socket" - }, - speaker: { - id: "speaker", - friendlyName: "Speaker" - }, - solarpanel: { - id: "solarpanel", - friendlyName: "Solar Panel" - }, - sunshade: { - id: "sunshade", - friendlyName: "Sunshade" - }, - thermostat: { - id: "thermostat", - friendlyName: "Thermostat" - }, - tv: { - id: "tv", - friendlyName: "TV" - }, - vacuumcleaner: { - id: "vacuumcleaner", - friendlyName: "Vacuum Cleaner" - }, - windowcoverings: { - id: "windowcoverings", - friendlyName: "Window Coverings" - }, - airconditioning: { - id: "airconditioning", - friendlyName: "Air Conditioning" - }, - bicycle: { - id: "bicycle", - friendlyName: "Bicycle" - }, - battery: { - id: "battery", - friendlyName: "Battery" - }, - car: { - id: "car", - friendlyName: "Car" - }, - boiler: { - id: "boiler", - friendlyName: "Boiler" - }, - dehumidifier: { - id: "dehumidifier", - friendlyName: "Dehumidifier" - }, - dishwasher: { - id: "dishwasher", - friendlyName: "Dishwasher" - }, - diffuser: { - id: "diffuser", - friendlyName: "Diffuser" - }, - evcharger: { - id: "evcharger", - friendlyName: "EV Charger" - }, - dryer: { - id: "dryer", - friendlyName: "Dryer" - }, - cooktop: { - id: "cooktop", - friendlyName: "Cooktop" - }, - faucet: { - id: "faucet", - friendlyName: "Faucet" - }, - fireplace: { - id: "fireplace", - friendlyName: "Fireplace" - }, - freezer: { - id: "freezer", - friendlyName: "Freezer" - }, - fridge_and_freezer: { - id: "fridge_and_freezer", - friendlyName: "Fridge and Freezer" - }, - fridge: { - id: "fridge", - friendlyName: "Fridge" - }, - gameconsole: { - id: "gameconsole", - friendlyName: "Game Console" - }, - grill: { - id: "grill", - friendlyName: "Grill" - }, - heatpump: { - id: "heatpump", - friendlyName: "Heat Pump" - }, - hood: { - id: "hood", - friendlyName: "Hood" - }, - humidifier: { - id: "humidifier", - friendlyName: "Humidifier" - }, - mediaplayer: { - id: "mediaplayer", - friendlyName: "Media Player" - }, - airtreatment: { - id: "airtreatment", - friendlyName: "Air Treatment" - }, - lawnmower: { - id: "lawnmower", - friendlyName: "Lawnmower" - }, - mop: { - id: "mop", - friendlyName: "Mop" - }, - oven: { - id: "oven", - friendlyName: "Oven" - }, - multicooker: { - id: "multicooker", - friendlyName: "Multi-cooker" - }, - airpurifier: { - id: "airpurifier", - friendlyName: "Air Purifier" - }, - petfeeder: { - id: "petfeeder", - friendlyName: "Pet Feeder" - }, - scooter: { - id: "scooter", - friendlyName: "Scooter" - }, - radiator: { - id: "radiator", - friendlyName: "Radiator" - }, - settopbox: { - id: "settopbox", - friendlyName: "Set-top Box" - }, - shutterblinds: { - id: "shutterblinds", - friendlyName: "Shutter Blinds" - }, - fryer: { - id: "fryer", - friendlyName: "Fryer" - }, - smokealarm: { - id: "smokealarm", - friendlyName: "Smoke Alarm" - }, - vehicle: { - id: "vehicle", - friendlyName: "Vehicle" - }, - washer: { - id: "washer", - friendlyName: "Washer" - }, - airfryer: { - id: "airfryer", - friendlyName: "Air Fryer" - }, - washer_and_dryer: { - id: "washer_and_dryer", - friendlyName: "Washer and Dryer" - }, - waterpurifier: { - id: "waterpurifier", - friendlyName: "Water Purifier" - }, - waterheater: { - id: "waterheater", - friendlyName: "Water Heater" - }, - oven_and_microwave: { - id: "oven_and_microwave", - friendlyName: "Oven and Microwave" - }, - microwave: { - id: "microwave", - friendlyName: "Microwave" - }, - watervalve: { - id: "watervalve", - friendlyName: "Water Valve" - }, - sprinkler: { - id: "sprinkler", - friendlyName: "Sprinkler" - }, - siren: { - id: "siren", - friendlyName: "Siren" - }, - networkrouter: { - id: "networkrouter", - friendlyName: "Network Router" - } - }; - - static getAllDeviceClasses(): { [key: string]: DeviceClass } { - return this.deviceClasses; - } -} \ No newline at end of file diff --git a/lib/SensorCapabilitiesManager.ts b/lib/SensorCapabilitiesManager.ts deleted file mode 100644 index 5a6fef0..0000000 --- a/lib/SensorCapabilitiesManager.ts +++ /dev/null @@ -1,107 +0,0 @@ -type SensorCapability = { - id: string; - friendlyName: string; - units?: string; -} - -export class SensorCapabilitiesManager { - - static readonly sensorCapabilities: { - [key: string]: SensorCapability; - } = { - measure_battery: { - id: "measure_battery", - friendlyName: "Battery", - units: "%" - }, - measure_co: { - id: "measure_co", - friendlyName: "CO", - units: "ppm" - }, - measure_co2: { - id: "measure_co2", - friendlyName: "CO2", - units: "ppm" - }, - measure_current: { - id: "measure_current", - friendlyName: "Current", - units: "A" - }, - measure_dust: { - id: "measure_dust", - friendlyName: "Dust", - units: "µg/m³" - }, - measure_humidity: { - id: "measure_humidity", - friendlyName: "Humidity", - units: "%" - }, - measure_luminance: { - id: "measure_luminance", - friendlyName: "Luminance", - units: "lux" - }, - measure_noise: { - id: "measure_noise", - friendlyName: "Noise", - units: "dB" - }, - measure_pm25: { - id: "measure_pm25", - friendlyName: "PM2.5", - units: "µg/m³" - }, - measure_power: { - id: "measure_power", - friendlyName: "Power", - units: "W" - }, - measure_pressure: { - id: "measure_pressure", - friendlyName: "Pressure", - units: "mbar" - }, - measure_rain: { - id: "measure_rain", - friendlyName: "Rain", - units: "mm" - }, - measure_temperature: { - id: "measure_temperature", - friendlyName: "Temperature", - units: "°C" - }, - measure_ultraviolet: { - id: "measure_ultraviolet", - friendlyName: "UV", - units: "uv" - }, - measure_voltage: { - id: "measure_voltage", - friendlyName: "Voltage", - units: "V" - }, - measure_water: { - id: "measure_water", - friendlyName: "Water", - units: "L" - }, - measure_wind_angle: { - id: "measure_wind_angle", - friendlyName: "Wind Angle", - units: "°" - }, - measure_wind_strength: { - id: "measure_wind_strength", - friendlyName: "Wind Strength", - units: "m/s" - } - }; - - static getAllSensorCapabilities(): { [key: string]: SensorCapability } { - return this.sensorCapabilities; - } -} \ No newline at end of file diff --git a/lib/TriggerCardAnyDeviceOnOff.ts b/lib/TriggerCardAnyDeviceOnOff.ts index 423ac7e..ef69987 100644 --- a/lib/TriggerCardAnyDeviceOnOff.ts +++ b/lib/TriggerCardAnyDeviceOnOff.ts @@ -1,10 +1,10 @@ import { ExtendedDevice, ExtendedDeviceCapability, ExtendedHomeyAPIV3Local } from "homey-api"; import Homey from "homey/lib/Homey"; -import { DeviceClassManager } from "./DeviceClassManager"; import { FlowCard, FlowCardTrigger } from "homey"; import handleZoneAutocomplete from "../utils/handleZoneAutocomplete"; import ZonesDb from "./ZonesDb"; import CustomError from "./CustomError"; +import HomeyLib from "homey-lib"; export default class TriggerCardAnyDeviceTurnedOn { @@ -89,17 +89,18 @@ export default class TriggerCardAnyDeviceTurnedOn { this.triggerCard.registerArgumentAutocompleteListener('zone', async (query: string) => await handleZoneAutocomplete(query, this.zonesDb)); this.triggerCard.registerArgumentAutocompleteListener('deviceClass', async (query: string): Promise => { - const deviceClasses = DeviceClassManager.getAllDeviceClasses(); + const deviceClasses = HomeyLib.Device.getClasses(); const results = [{ name: this.homey.__('any_type') ?? "Any type", id: 'any_type', }]; - results.push(...Object.values(deviceClasses).map((deviceClass) => { + const languageCode = this.homey.i18n.getLanguage(); + results.push(...Object.entries(deviceClasses).map(([key, deviceClass]) => { return { - name: this.homey.__(deviceClass.id) ?? deviceClass.friendlyName, - id: deviceClass.id, + name: deviceClass.title[languageCode], + id: key, }; })); diff --git a/locales/en.json b/locales/en.json index 779152b..b8478c2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1,77 +1,5 @@ { "any_type": "Any type", - "amplifier": "Amplifier", - "blinds": "Blinds", - "button": "Button", - "camera": "Camera", - "coffeemachine": "Coffee Machine", - "curtain": "Curtain", - "doorbell": "Doorbell", - "fan": "Fan", - "garagedoor": "Garage Door", - "heater": "Heater", - "homealarm": "Home Alarm", - "kettle": "Kettle", - "light": "Light", - "lock": "Lock", - "other": "Other", - "remote": "Remote", - "sensor": "Sensor", - "socket": "Socket", - "speaker": "Speaker", - "solarpanel": "Solar Panel", - "sunshade": "Sunshade", - "thermostat": "Thermostat", - "tv": "TV", - "vacuumcleaner": "Vacuum Cleaner", - "windowcoverings": "Window Coverings", - "airconditioning": "Air Conditioning", - "bicycle": "Bicycle", - "battery": "Battery", - "car": "Car", - "boiler": "Boiler", - "dehumidifier": "Dehumidifier", - "dishwasher": "Dishwasher", - "diffuser": "Diffuser", - "evcharger": "EV Charger", - "dryer": "Dryer", - "cooktop": "Cooktop", - "faucet": "Faucet", - "fireplace": "Fireplace", - "freezer": "Freezer", - "fridge_and_freezer": "Fridge and Freezer", - "fridge": "Fridge", - "gameconsole": "Game Console", - "grill": "Grill", - "heatpump": "Heat Pump", - "hood": "Hood", - "humidifier": "Humidifier", - "mediaplayer": "Media Player", - "airtreatment": "Air Treatment", - "lawnmower": "Lawnmower", - "mop": "Mop", - "oven": "Oven", - "multicooker": "Multi-cooker", - "airpurifier": "Air Purifier", - "petfeeder": "Pet Feeder", - "scooter": "Scooter", - "radiator": "Radiator", - "settopbox": "Set-top Box", - "shutterblinds": "Shutter Blinds", - "fryer": "Fryer", - "smokealarm": "Smoke Alarm", - "vehicle": "Vehicle", - "washer": "Washer", - "airfryer": "Air Fryer", - "washer_and_dryer": "Washer and Dryer", - "waterpurifier": "Water Purifier", - "waterheater": "Water Heater", - "oven_and_microwave": "Oven and Microwave", - "microwave": "Microwave", - "watervalve": "Water Valve", - "sprinkler": "Sprinkler", - "siren": "Siren", - "networkrouter": "Network Router", "any_sensor": "Any sensor", "measure_battery": "Battery", "measure_co": "CO", diff --git a/locales/nl.json b/locales/nl.json index 076b598..0a48a48 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -1,77 +1,5 @@ { "any_type": "Elk type", - "amplifier": "Versterker", - "blinds": "Jaloezieën", - "button": "Knop", - "camera": "Camera", - "coffeemachine": "Koffiezetapparaat", - "curtain": "Gordijn", - "doorbell": "Deurbel", - "fan": "Ventilator", - "garagedoor": "Garagedeur", - "heater": "Verwarming", - "homealarm": "Huisalarm", - "kettle": "Waterkoker", - "light": "Lamp", - "lock": "Slot", - "other": "Overig", - "remote": "Afstandsbediening", - "sensor": "Sensor", - "socket": "Stopcontact", - "speaker": "Luidspreker", - "solarpanel": "Zonnepaneel", - "sunshade": "Zonnescherm", - "thermostat": "Thermostaat", - "tv": "Televisie", - "vacuumcleaner": "Stofzuiger", - "windowcoverings": "Raambekleding", - "airconditioning": "Airconditioning", - "bicycle": "Fiets", - "battery": "Batterij", - "car": "Auto", - "boiler": "Boiler", - "dehumidifier": "Ontvochtiger", - "dishwasher": "Vaatwasser", - "diffuser": "Diffuser", - "evcharger": "Elektrische Autolader", - "dryer": "Droger", - "cooktop": "Kookplaat", - "faucet": "Kraan", - "fireplace": "Openhaard", - "freezer": "Vriezer", - "fridge_and_freezer": "Koelkast en Vriezer", - "fridge": "Koelkast", - "gameconsole": "Spelconsole", - "grill": "Grill", - "heatpump": "Warmtepomp", - "hood": "Afzuigkap", - "humidifier": "Luchtbevochtiger", - "mediaplayer": "Mediaspeler", - "airtreatment": "Luchtbehandeling", - "lawnmower": "Grasmaaier", - "mop": "Dweil", - "oven": "Oven", - "multicooker": "Multicooker", - "airpurifier": "Luchtreiniger", - "petfeeder": "Dierenvoederautomaat", - "scooter": "Scooter", - "radiator": "Radiator", - "settopbox": "Settopbox", - "shutterblinds": "Rolluiken", - "fryer": "Frituurpan", - "smokealarm": "Rookmelder", - "vehicle": "Voertuig", - "washer": "Wasmachine", - "airfryer": "Airfryer", - "washer_and_dryer": "Was-droogcombinatie", - "waterpurifier": "Waterzuiveraar", - "waterheater": "Boiler", - "oven_and_microwave": "Oven en Magnetron", - "microwave": "Magnetron", - "watervalve": "Waterkraan", - "sprinkler": "Sproeier", - "siren": "Sirene", - "networkrouter": "Netwerkrouter", "any_sensor": "Elke sensor", "measure_battery": "Batterij", "measure_co": "CO", diff --git a/package-lock.json b/package-lock.json index bfb2921..3d688ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "homey-api": "^3.6.2", + "homey-lib": "^2.32.5", "homey-log": "^2.1.0" }, "devDependencies": { @@ -663,7 +664,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2209,7 +2209,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, "license": "MIT" }, "node_modules/fast-glob": { @@ -2246,7 +2245,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -2677,6 +2675,30 @@ "node": ">=16" } }, + "node_modules/homey-lib": { + "version": "2.32.5", + "resolved": "https://registry.npmjs.org/homey-lib/-/homey-lib-2.32.5.tgz", + "integrity": "sha512-yGHtIcP8Kw7F3wVWbTPO8rtt68hTwgaQkenfVHXME/RtSqWjrvUt8Uj1i0xUYypn47MKVElzj7xHEAaNBAkSbA==", + "license": "ISC", + "dependencies": { + "ajv": "^6.1.1", + "image-size": "^0.6.2", + "semver": "^5.7.0", + "tinycolor2": "^1.4.1" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/homey-lib/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/homey-log": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/homey-log/-/homey-log-2.1.0.tgz", @@ -2707,6 +2729,18 @@ "node": ">= 4" } }, + "node_modules/image-size": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.6.3.tgz", + "integrity": "sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA==", + "license": "MIT", + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -3185,7 +3219,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -3748,7 +3781,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -4536,6 +4568,12 @@ "node": ">=8" } }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT" + }, "node_modules/to-array": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", @@ -4776,7 +4814,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" diff --git a/package.json b/package.json index 1654ce5..39fb068 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "homey-api": "^3.6.2", + "homey-lib": "^2.32.5", "homey-log": "^2.1.0" } }