From 507466d7177668d5c54c7eebff34a0649a3f944c Mon Sep 17 00:00:00 2001 From: jamesmnixon <84355094+jamesmnixon@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:30:18 -0700 Subject: [PATCH] Update Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy There are some values that return as an empty string. instead of bool 0 or 1 for whether a device is read_only or not. When this happens it causes a `NumberFormatException` error. This try catch handles that and defaults to not read-only and allows the scanning and input creation to proceed. --- .../Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/FullDrivers/Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy b/FullDrivers/Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy index c2447f0..8bd2fc5 100644 --- a/FullDrivers/Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy +++ b/FullDrivers/Any_Z_Wave_Dimmer_Driver_v1_5_5_425.groovy @@ -2160,11 +2160,14 @@ Map createInputControls(data) // library marker zwaveTools.openSmarthouseTools, Map inputControls = [:] // library marker zwaveTools.openSmarthouseTools, line 155 data?.each // library marker zwaveTools.openSmarthouseTools, line 156 { // library marker zwaveTools.openSmarthouseTools, line 157 - if (it.read_only as Integer) { // library marker zwaveTools.openSmarthouseTools, line 158 - log.info "Device ${device.displayName}: Parameter ${it.param_id}-${it.label} is read-only. No input control created." // library marker zwaveTools.openSmarthouseTools, line 159 - return // library marker zwaveTools.openSmarthouseTools, line 160 - } // library marker zwaveTools.openSmarthouseTools, line 161 - + try{ // try/catch to handle the possible 'empty string' value + if (it.read_only as Integer) { // library marker zwaveTools.openSmarthouseTools, line 158 + log.info "Device ${device.displayName}: Parameter ${it.param_id}-${it.label} is read-only. No input control created." // library marker zwaveTools.openSmarthouseTools, line 159 + return // library marker zwaveTools.openSmarthouseTools, line 160 + } // library marker zwaveTools.openSmarthouseTools, line 161 + } catch (NumberFormatException e) { + log.error "Device ${device.displayName}: Parameter ${it.param_id}-${it.label} is empty. Treating as not read_only. - Rely on your user manual for proper values!." + } if (it.bitmask.toInteger()) // library marker zwaveTools.openSmarthouseTools, line 163 { // library marker zwaveTools.openSmarthouseTools, line 164 if (!(inputControls?.get(it.param_id))) // library marker zwaveTools.openSmarthouseTools, line 165