From 5906ee8a0b919d2187e256fb85373a03a39e6c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20K=C3=B6pp?= Date: Tue, 8 Oct 2024 21:01:04 +0200 Subject: [PATCH] Fix/Improve Batch-Export: Check Channel-Definition before Start of Export + UI * Fix: Check Before Export (Channel in Range) * Batch Export UI: Improve Layout for Multi-Export Format * Fix: ExportSourcesString should reset ... --- src/ConfigTransfer.script.js | 8 ++++++++ src/ConfigTransfer.share.xml | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/ConfigTransfer.script.js b/src/ConfigTransfer.script.js index 06d0048..062bd5a 100644 --- a/src/ConfigTransfer.script.js +++ b/src/ConfigTransfer.script.js @@ -49,11 +49,19 @@ function uctParseRangesString(channelsString) { function uctBtnExport(device, online, progress, context) { Log.info("OpenKNX ConfigTransfer: Handle Channel Export ...") var module = uctModuleOrder[device.getParameterByName(context.p_moduleSelection).value]; + var moduleChannelCount = uctChannelParams[module].channels; + var channelSource = device.getParameterByName(context.p_channelSource).value; var channels = [channelSource]; if (channelSource == 253) { channels = uctParseRangesString(device.getParameterByName(context.p_channelSourcesString).value); } + if (channels.length == 0) { + throw new Error("Kein Kanal definiert!"); + } + if (/* channels.length > 0 */ channels[channels.length - 1] > moduleChannelCount) { + throw new Error("Kanal außerhalb von Modul-Bereich!"); + } if (channels.length > 1) { Log.info("OpenKNX ConfigTransfer: Multi-Channel " + channels.join(",")); } diff --git a/src/ConfigTransfer.share.xml b/src/ConfigTransfer.share.xml index 019a5c7..fd38428 100644 --- a/src/ConfigTransfer.share.xml +++ b/src/ConfigTransfer.share.xml @@ -411,6 +411,7 @@ + @@ -561,7 +562,18 @@ - + + + + + + + + + + + +