Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#3003 from SmartThingsCommunit…
Browse files Browse the repository at this point in the history
…y/production

Rolling down production to staging
  • Loading branch information
workingmonk authored Apr 11, 2018
2 parents 7b53ac6 + 2e0693d commit 155f6f8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def getEcobeeDevices() {

Map sensorsDiscovered() {
def map = [:]
def remoteSensors = state.remoteSensors2
def remoteSensors = state.remoteSensors2 ?: [:]
remoteSensors.each { key, sensors ->
map[key] = sensors.name
}
Expand All @@ -385,7 +385,7 @@ Map sensorsDiscovered() {

def switchesDiscovered() {
def map = [:]
def switches = state.switchList
def switches = state.switchList ?: [:]
switches.each { key, ecobeeSwitch ->
map[key] = ecobeeSwitch.name
}
Expand Down Expand Up @@ -416,9 +416,9 @@ def updated() {
}

def initialize() {
def thermostatList = state.thermostats
def remoteSensors = state.remoteSensors2
def switchList = state.switchList
def thermostatList = state.thermostats ?: [:]
def remoteSensors = state.remoteSensors2 ?: [:]
def switchList = state.switchList ?: [:]
def childThermostats = thermostats.collect { dni ->
def d = getChildDevice(dni)
if(!d) {
Expand Down Expand Up @@ -496,9 +496,9 @@ def initialize() {

def purgeChildDevice(childDevice) {
def dni = childDevice.device.deviceNetworkId
def thermostatList = state.thermostats
def remoteSensors = state.remoteSensors2
def switchList = state.switchList
def thermostatList = state.thermostats ?: [:]
def remoteSensors = state.remoteSensors2 ?: [:]
def switchList = state.switchList ?: [:]
if (thermostatList[dni]) {
thermostatList.remove(dni)
state.thermostats = thermostatList
Expand Down

0 comments on commit 155f6f8

Please sign in to comment.