Skip to content

Commit 155f6f8

Browse files
authored
Merge pull request SmartThingsCommunity#3003 from SmartThingsCommunity/production
Rolling down production to staging
2 parents 7b53ac6 + 2e0693d commit 155f6f8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def getEcobeeDevices() {
376376

377377
Map sensorsDiscovered() {
378378
def map = [:]
379-
def remoteSensors = state.remoteSensors2
379+
def remoteSensors = state.remoteSensors2 ?: [:]
380380
remoteSensors.each { key, sensors ->
381381
map[key] = sensors.name
382382
}
@@ -385,7 +385,7 @@ Map sensorsDiscovered() {
385385

386386
def switchesDiscovered() {
387387
def map = [:]
388-
def switches = state.switchList
388+
def switches = state.switchList ?: [:]
389389
switches.each { key, ecobeeSwitch ->
390390
map[key] = ecobeeSwitch.name
391391
}
@@ -416,9 +416,9 @@ def updated() {
416416
}
417417

418418
def initialize() {
419-
def thermostatList = state.thermostats
420-
def remoteSensors = state.remoteSensors2
421-
def switchList = state.switchList
419+
def thermostatList = state.thermostats ?: [:]
420+
def remoteSensors = state.remoteSensors2 ?: [:]
421+
def switchList = state.switchList ?: [:]
422422
def childThermostats = thermostats.collect { dni ->
423423
def d = getChildDevice(dni)
424424
if(!d) {
@@ -496,9 +496,9 @@ def initialize() {
496496

497497
def purgeChildDevice(childDevice) {
498498
def dni = childDevice.device.deviceNetworkId
499-
def thermostatList = state.thermostats
500-
def remoteSensors = state.remoteSensors2
501-
def switchList = state.switchList
499+
def thermostatList = state.thermostats ?: [:]
500+
def remoteSensors = state.remoteSensors2 ?: [:]
501+
def switchList = state.switchList ?: [:]
502502
if (thermostatList[dni]) {
503503
thermostatList.remove(dni)
504504
state.thermostats = thermostatList

0 commit comments

Comments
 (0)