mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
PROB-870 - Harmony fails to save credentials
It seams like the user removed some activities on Harmony side without removing them from SmartThings. This is causing an issue when adding new activities. This fix checks if the activity still exists before creating a new device.
This commit is contained in:
@@ -419,9 +419,11 @@ def addDevice() {
|
||||
def d = getChildDevice(dni)
|
||||
if(!d) {
|
||||
def newAction = state.HarmonyActivities.find { it.key == dni }
|
||||
d = addChildDevice("smartthings", "Harmony Activity", dni, null, [label:"${newAction.value} [Harmony Activity]"])
|
||||
log.trace "created ${d.displayName} with id $dni"
|
||||
poll()
|
||||
if (newAction) {
|
||||
d = addChildDevice("smartthings", "Harmony Activity", dni, null, [label:"${newAction.value} [Harmony Activity]"])
|
||||
log.trace "created ${d.displayName} with id $dni"
|
||||
poll()
|
||||
}
|
||||
} else {
|
||||
log.trace "found ${d.displayName} with id $dni already exists"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user