Merge pull request #1892 from jackchi/enrollment-fix-updated

[CHF-595] Device Health enrollment needs to be in both updated() & installed()
This commit is contained in:
Vinay Rao
2017-04-11 12:27:56 -07:00
committed by GitHub
8 changed files with 82 additions and 9 deletions

View File

@@ -57,10 +57,20 @@ metadata {
}
}
void installed() {
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
}
void installed() {
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// parse events into attributes
def parse(description) {
log.debug "parse() - $description"

View File

@@ -45,10 +45,20 @@ metadata {
}
}
void installed() {
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
}
void installed() {
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// parse events into attributes
def parse(description) {
log.debug "Parsing '${description}'"

View File

@@ -66,10 +66,20 @@ metadata {
}
}
void installed() {
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
}
void installed() {
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// parse events into attributes
def parse(description) {
log.debug "parse() - $description"

View File

@@ -50,10 +50,19 @@ metadata {
}
}
void installed() {
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
}
void installed() {
log.debug "installed()"
initialize()
}
def updated() {
initialize()
}
// parse events into attributes
def parse(description) {
log.debug "parse() - $description"

View File

@@ -55,10 +55,20 @@ metadata {
}
}
void installed() {
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false)
}
void installed() {
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// parse events into attributes
def parse(description) {
log.debug "parse() - $description"

View File

@@ -64,8 +64,18 @@ metadata {
}
}
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false)
}
void installed() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}")
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// handle commands

View File

@@ -55,8 +55,18 @@ metadata {
}
}
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false)
}
void installed() {
sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}")
log.debug "installed()"
initialize()
}
def updated() {
log.debug "updated()"
initialize()
}
// handle commands

View File

@@ -40,14 +40,18 @@ metadata {
}
}
def initialize() {
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
}
def installed() {
log.debug "installed()"
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
initialize()
}
def updated() {
log.debug "updated()"
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false)
initialize()
}
def startActivity(String activityId) {