diff --git a/devicetypes/smartthings/aeon-key-fob.src/aeon-key-fob.groovy b/devicetypes/smartthings/aeon-key-fob.src/aeon-key-fob.groovy index b6d376f..40f5403 100644 --- a/devicetypes/smartthings/aeon-key-fob.src/aeon-key-fob.groovy +++ b/devicetypes/smartthings/aeon-key-fob.src/aeon-key-fob.groovy @@ -120,6 +120,15 @@ def configure() { return cmd } + +def installed() { + initialize() +} + def updated() { + initialize() +} + +def initialize() { sendEvent(name: "numberOfButtons", value: 4) } diff --git a/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy b/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy index 4906fac..f1a0c0b 100644 --- a/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy +++ b/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy @@ -109,6 +109,15 @@ def configure() { return cmds } + +def installed() { + initialize() +} + def updated() { + initialize() +} + +def initialize() { sendEvent(name: "numberOfButtons", value: 4) } diff --git a/devicetypes/smartthings/cooper-rf9500.src/cooper-rf9500.groovy b/devicetypes/smartthings/cooper-rf9500.src/cooper-rf9500.groovy index 2f83f77..5e22791 100644 --- a/devicetypes/smartthings/cooper-rf9500.src/cooper-rf9500.groovy +++ b/devicetypes/smartthings/cooper-rf9500.src/cooper-rf9500.groovy @@ -183,6 +183,15 @@ def updateState(String name, String value) { device.updateDataValue(name, value) } + +def installed() { + initialize() +} + def updated() { + initialize() +} + +def initialize() { sendEvent(name: "numberOfButtons", value: 3) } diff --git a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy index 5cf3743..5d60112 100644 --- a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy +++ b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy @@ -57,6 +57,7 @@ def parse(String description) { private Map parseBasicMessage(description) { def name = parseName(description) + def results = [:] if (name != null) { def value = parseValue(description) def linkText = getLinkText(device) @@ -64,7 +65,7 @@ private Map parseBasicMessage(description) { def handlerName = value def isStateChange = isStateChange(device, name, value) - def results = [ + results = [ name : name, value : value, linkText : linkText, @@ -73,8 +74,6 @@ private Map parseBasicMessage(description) { isStateChange : isStateChange, displayed : displayed(description, isStateChange) ] - } else { - results = [:] } log.debug "Parse returned $results.descriptionText" return results diff --git a/devicetypes/smartthings/testing/simulated-minimote.src/simulated-minimote.groovy b/devicetypes/smartthings/testing/simulated-minimote.src/simulated-minimote.groovy index c2bb0cd..a538f81 100644 --- a/devicetypes/smartthings/testing/simulated-minimote.src/simulated-minimote.groovy +++ b/devicetypes/smartthings/testing/simulated-minimote.src/simulated-minimote.groovy @@ -126,6 +126,15 @@ private hold(button) { sendEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was held", isStateChange: true) } + +def installed() { + initialize() +} + def updated() { + initialize() +} + +def initialize() { sendEvent(name: "numberOfButtons", value: 4) }