mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-01 14:23:07 +01:00
removed functions from uninstall that may have been causing errors during the uninstall process; added an initializer for the atomicState.eventBuffer on update if it's whiped away; added a check for access key in createBucket to make the function more idempotent
This commit is contained in:
@@ -242,6 +242,9 @@ def updated() {
|
|||||||
if (atomicState.bucketKey != null && atomicState.accessKey != null) {
|
if (atomicState.bucketKey != null && atomicState.accessKey != null) {
|
||||||
atomicState.isBucketCreated = false
|
atomicState.isBucketCreated = false
|
||||||
}
|
}
|
||||||
|
if (atomicState.eventBuffer == null) {
|
||||||
|
atomicState.eventBuffer = [];
|
||||||
|
}
|
||||||
|
|
||||||
subscribeToEvents()
|
subscribeToEvents()
|
||||||
|
|
||||||
@@ -249,15 +252,16 @@ def updated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def uninstalled() {
|
def uninstalled() {
|
||||||
unsubscribe()
|
|
||||||
unschedule()
|
|
||||||
log.debug "uninstalled (version $atomicState.version)"
|
log.debug "uninstalled (version $atomicState.version)"
|
||||||
}
|
}
|
||||||
|
|
||||||
def createBucket() {
|
def createBucket() {
|
||||||
|
|
||||||
if (!atomicState.bucketName) {
|
if (!atomicState.bucketName) {
|
||||||
atomicState.bucketName = atomicState.bucketKey
|
atomicState.bucketName = atomicState.bucketKey;
|
||||||
|
}
|
||||||
|
if (!atomicState.accessKey) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
def bucketName = "${atomicState.bucketName}"
|
def bucketName = "${atomicState.bucketName}"
|
||||||
def bucketKey = "${atomicState.bucketKey}"
|
def bucketKey = "${atomicState.bucketKey}"
|
||||||
|
|||||||
Reference in New Issue
Block a user