Ecobee detect Smart Away (#4769)

* Ecobee autoAway Event

* Update ecobee.py

Checking if event['running'] true is pointless because if false event['type'] will equal template and when true type will only be 'hold' or 'autoAway' so I've removed this check from the statement
This commit is contained in:
devdelay 2016-12-11 17:46:10 -05:00 committed by Paulus Schoutsen
parent 99f1ea9b59
commit 080c4efb00

View File

@ -195,8 +195,9 @@ class Thermostat(ClimateDevice):
mode = self.mode
events = self.thermostat['events']
for event in events:
if event['running']:
mode = event['holdClimateRef']
if event['holdClimateRef'] == 'away' or \
event['type'] == 'autoAway':
mode = "away"
break
return 'away' in mode