Skip to content

Commit 7ef4ff1

Browse files
committed
Z-Wave Tweaker v0.08
initialise(): Removes any null ccIds parsed from the rawDescription.
1 parent 48ec7b6 commit 7ef4ff1

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

devices/zwave-tweaker/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ Do not delete any setting values below this line! They belong to the original de
219219

220220
## Version History
221221

222+
#### 2017-03-16: v0.08
223+
* initialise(): Removes any null ccIds parsed from the rawDescription.
224+
222225
#### 2017-03-15: v0.07
223226
* cleanUp(): Uses state.remove() and device.updateSetting()
224227

devices/zwave-tweaker/zwave-tweaker.groovy

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*
66
* Author: David Lomas (codersaur)
77
*
8-
* Date: 2017-03-15
8+
* Date: 2017-03-16
99
*
10-
* Version: 0.07
10+
* Version: 0.08
1111
*
1212
* Source: https://github.com/codersaur/SmartThings/tree/master/devices/zwave-tweaker
1313
*
@@ -229,7 +229,7 @@ metadata {
229229
type: "text",
230230
required: false
231231
)
232-
232+
233233
input (
234234
name: "zwtAssocGroupCc",
235235
title: "Command Class:",
@@ -1599,13 +1599,13 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
15991599
/**
16001600
* initialise()
16011601
*
1602-
* Sets up meta-data caches and determines if the device is using security encapsulation.
1602+
* Sets up meta-data caches, parses fingerprint, and determines if the device is using security encapsulation.
16031603
**/
16041604
private initialise() {
16051605
logger("initialise()","trace")
16061606

1607-
// Initialise parameter and association group meta data stores if they don't exist:
1608-
if (!state.zwtGeneralMd) state.zwtGeneralMd = [:]
1607+
// Initialise meta-data stores if they don't exist:
1608+
if (!state.zwtGeneralMd) state.zwtGeneralMd = [:] // Map!
16091609
if (!state.zwtCommandsMd) state.zwtCommandsMd = []
16101610
if (!state.zwtAssocGroupsMd) state.zwtAssocGroupsMd = []
16111611
if (!state.zwtEndpointsMd) state.zwtEndpointsMd = []
@@ -1626,6 +1626,7 @@ private initialise() {
16261626
ccIds = device.rawDescription.findAll(/0x\p{XDigit}+/)
16271627
if (ccIds.size() > 0) { ccIds.remove(0) }
16281628
}
1629+
ccIds.removeAll([null])
16291630
state.zwtGeneralMd.commandClassIds = ccIds.sort().collect { Integer.parseInt(it.replace("0x",""),16) } // Parse hex strings to ints.
16301631
state.zwtGeneralMd.commandClassNames = toCcNames(state.zwtGeneralMd.commandClassIds,true) // Parse Ids to names.
16311632
logger("Supported Command Classes: ${state.zwtGeneralMd.commandClassNames}","info")
@@ -2114,21 +2115,21 @@ private cleanUp() {
21142115
state.remove("zwtAssocGroupTarget")
21152116
state.remove("zwtParamTarget")
21162117

2117-
device.updateSetting("zwtLoggingLevelIDE", null)
2118-
device.updateSetting("zwtAssocGroupsScanStart", null)
2119-
device.updateSetting("zwtAssocGroupsScanStop", null)
2120-
device.updateSetting("zwtEndpointsScanStart", null)
2121-
device.updateSetting("zwtEndpointsScanStop", null)
2122-
device.updateSetting("zwtParamsScanStart", null)
2123-
device.updateSetting("zwtParamsScanStop", null)
2124-
device.updateSetting("zwtAssocGroupId", null)
2125-
device.updateSetting("zwtAssocGroupMembers", null)
2126-
device.updateSetting("zwtAssocGroupCc", null)
2127-
device.updateSetting("zwtParamId", null)
2128-
device.updateSetting("zwtParamValue", null)
2129-
device.updateSetting("zwtProtectLocal", null)
2130-
device.updateSetting("zwtProtectRF", null)
2131-
device.updateSetting("zwtSwitchAllMode", null)
2118+
device?.updateSetting("zwtLoggingLevelIDE", null)
2119+
device?.updateSetting("zwtAssocGroupsScanStart", null)
2120+
device?.updateSetting("zwtAssocGroupsScanStop", null)
2121+
device?.updateSetting("zwtEndpointsScanStart", null)
2122+
device?.updateSetting("zwtEndpointsScanStop", null)
2123+
device?.updateSetting("zwtParamsScanStart", null)
2124+
device?.updateSetting("zwtParamsScanStop", null)
2125+
device?.updateSetting("zwtAssocGroupId", null)
2126+
device?.updateSetting("zwtAssocGroupMembers", null)
2127+
device?.updateSetting("zwtAssocGroupCc", null)
2128+
device?.updateSetting("zwtParamId", null)
2129+
device?.updateSetting("zwtParamValue", null)
2130+
device?.updateSetting("zwtProtectLocal", null)
2131+
device?.updateSetting("zwtProtectRF", null)
2132+
device?.updateSetting("zwtSwitchAllMode", null)
21322133

21332134
}
21342135

0 commit comments

Comments
 (0)