From 9ec0ecfc8ee61c4bc18d6900152b0959d7f72a4f Mon Sep 17 00:00:00 2001 From: Olivier Zalmanski <88216225+OlivierZal@users.noreply.github.com> Date: Sun, 3 Dec 2023 00:53:45 +0100 Subject: [PATCH] Change auto mode logic --- .homeycompose/capabilities/mode.json | 26 ---------- app.json | 74 +++++++++++++--------------- drivers/nuos/device.ts | 2 +- drivers/nuos/driver.compose.json | 48 +++++++++++++----- 4 files changed, 71 insertions(+), 79 deletions(-) delete mode 100644 .homeycompose/capabilities/mode.json diff --git a/.homeycompose/capabilities/mode.json b/.homeycompose/capabilities/mode.json deleted file mode 100644 index 4e3a00c..0000000 --- a/.homeycompose/capabilities/mode.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "type": "enum", - "title": { - "en": "Mode", - "fr": "Mode" - }, - "getable": true, - "setable": true, - "uiComponent": "picker", - "values": [ - { - "id": "auto", - "title": { - "en": "Automatic", - "fr": "Automatique" - } - }, - { - "id": "manual", - "title": { - "en": "Manual", - "fr": "Manuel" - } - } - ] -} diff --git a/app.json b/app.json index 8160449..82ecbe3 100644 --- a/app.json +++ b/app.json @@ -134,34 +134,45 @@ "en": "Nuos" }, "capabilities": [ - "operation_mode", - "measure_temperature", - "measure_temperature.required", - "mode", "onoff", + "onoff.auto", "onoff.boost", "onoff.legionella", "onoff.preheating", - "target_temperature" + "measure_temperature", + "measure_temperature.required", + "target_temperature", + "operation_mode" ], "capabilitiesOptions": { - "measure_temperature.required": { + "onoff.auto": { "title": { - "en": "Process required temperature", - "fr": "Température requise pour le processus" + "en": "Automatic mode", + "fr": "Mode automatique" + }, + "insightsTitleTrue": { + "en": "Automatic mode turned on", + "fr": "Mode automatique activé" + }, + "insightsTitleFalse": { + "en": "Automatic mode turned off", + "fr": "Mode automatique désactivé" } }, "onoff.boost": { "title": { "en": "Boost", "fr": "Boost" + }, + "insightsTitleTrue": { + "en": "Boost turned on", + "fr": "Boost activé" + }, + "insightsTitleFalse": { + "en": "Boost turned off", + "fr": "Boost désactivé" } }, - "target_temperature": { - "min": 40, - "max": 75, - "step": 1 - }, "onoff.legionella": { "title": { "en": "Antilegionella", @@ -189,6 +200,17 @@ "en": "Preheating turned off", "fr": "Préchauffage désactivé" } + }, + "measure_temperature.required": { + "title": { + "en": "Process required temperature", + "fr": "Température requise pour le processus" + } + }, + "target_temperature": { + "min": 40, + "max": 75, + "step": 1 } }, "id": "nuos", @@ -235,32 +257,6 @@ } ], "capabilities": { - "mode": { - "type": "enum", - "title": { - "en": "Mode", - "fr": "Mode" - }, - "getable": true, - "setable": true, - "uiComponent": "picker", - "values": [ - { - "id": "auto", - "title": { - "en": "Automatic", - "fr": "Automatique" - } - }, - { - "id": "manual", - "title": { - "en": "Manual", - "fr": "Manuel" - } - } - ] - }, "operation_mode": { "type": "enum", "title": { diff --git a/drivers/nuos/device.ts b/drivers/nuos/device.ts index 4b89a11..c9e03ee 100644 --- a/drivers/nuos/device.ts +++ b/drivers/nuos/device.ts @@ -218,8 +218,8 @@ class NuosDevice extends withAPI(Device) { newData.plantData await this.setCapabilityValue('measure_temperature', waterTemp) await this.setCapabilityValue('measure_temperature.required', procReqTemp) - await this.setCapabilityValue('mode', Mode[mode]) await this.setCapabilityValue('onoff', on) + await this.setCapabilityValue('onoff.auto', (mode as Mode) === Mode.auto) await this.setCapabilityValue('onoff.boost', boostOn) await this.setCapabilityValue('operation_mode', OperationMode[opMode]) await this.setCapabilityValue('target_temperature', comfortTemp) diff --git a/drivers/nuos/driver.compose.json b/drivers/nuos/driver.compose.json index c4634b2..de3f34c 100644 --- a/drivers/nuos/driver.compose.json +++ b/drivers/nuos/driver.compose.json @@ -4,34 +4,45 @@ "en": "Nuos" }, "capabilities": [ - "operation_mode", - "measure_temperature", - "measure_temperature.required", - "mode", "onoff", + "onoff.auto", "onoff.boost", "onoff.legionella", "onoff.preheating", - "target_temperature" + "measure_temperature", + "measure_temperature.required", + "target_temperature", + "operation_mode" ], "capabilitiesOptions": { - "measure_temperature.required": { + "onoff.auto": { "title": { - "en": "Process required temperature", - "fr": "Température requise pour le processus" + "en": "Automatic mode", + "fr": "Mode automatique" + }, + "insightsTitleTrue": { + "en": "Automatic mode turned on", + "fr": "Mode automatique activé" + }, + "insightsTitleFalse": { + "en": "Automatic mode turned off", + "fr": "Mode automatique désactivé" } }, "onoff.boost": { "title": { "en": "Boost", "fr": "Boost" + }, + "insightsTitleTrue": { + "en": "Boost turned on", + "fr": "Boost activé" + }, + "insightsTitleFalse": { + "en": "Boost turned off", + "fr": "Boost désactivé" } }, - "target_temperature": { - "min": 40, - "max": 75, - "step": 1 - }, "onoff.legionella": { "title": { "en": "Antilegionella", @@ -59,6 +70,17 @@ "en": "Preheating turned off", "fr": "Préchauffage désactivé" } + }, + "measure_temperature.required": { + "title": { + "en": "Process required temperature", + "fr": "Température requise pour le processus" + } + }, + "target_temperature": { + "min": 40, + "max": 75, + "step": 1 } } }