diff --git a/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy b/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy index f58b346b176..e058021f28d 100644 --- a/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy +++ b/devicetypes/smartthings/aeon-minimote.src/aeon-minimote.groovy @@ -1,5 +1,4 @@ import groovy.json.JsonOutput -import groovy.json.JsonOutput /** * Copyright 2015 SmartThings @@ -15,7 +14,7 @@ import groovy.json.JsonOutput * */ metadata { - definition (name: "Aeon Minimote", namespace: "smartthings", author: "SmartThings", runLocally: true, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false) { + definition (name: "Aeon Minimote", namespace: "smartthings", author: "SmartThings", runLocally: true, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false, mcdSync: true) { capability "Actuator" capability "Button" capability "Holdable Button" @@ -128,27 +127,32 @@ def updated() { initialize() if (!childDevices) { createChildDevices() - } - else if (device.label != state.oldLabel) { + } else if (device.label != state.oldLabel) { childDevices.each { def segs = it.deviceNetworkId.split("/") def newLabel = "${device.displayName} button ${segs[-1]}" it.setLabel(newLabel) } state.oldLabel = device.label + } else { + childDevices.each { + it.sendEvent(name: "supportedButtonValues", value: ["pushed","held"].encodeAsJson(), displayed: false) + } } } def initialize() { sendEvent(name: "numberOfButtons", value: 4) sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zwave", scheme:"untracked"]), displayed: false) + sendEvent(name: "supportedButtonValues", value: ["pushed","held"].encodeAsJson(), displayed: false) } private void createChildDevices() { state.oldLabel = device.label for (i in 1..4) { - addChildDevice("Child Button", "${device.deviceNetworkId}/${i}", device.hubId, + def child = addChildDevice("Child Button", "${device.deviceNetworkId}/${i}", device.hubId, [completedSetup: true, label: "${device.displayName} button ${i}", isComponent: true, componentName: "button$i", componentLabel: "Button $i"]) + child.sendEvent(name: "supportedButtonValues", value: ["pushed","held"].encodeAsJson(), displayed: false) } }