Skip to content

Commit

Permalink
Added check for mode.
Browse files Browse the repository at this point in the history
Valid modes are 'cool', 'heat'  or 'range'
  • Loading branch information
Randy Levensalor committed Jan 6, 2013
1 parent e1bacdf commit bc69abc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def main():
sys.exit(-1)
n.set_fan(args[1])
elif (cmd == "mode"):
if len(args)<2:
if len(args)<2 or args[1] not in {"cool", "heat", "range"}:
print "please specify a thermostat mode of 'cool', 'heat' or 'range'"
sys.exit(-1)
n.set_mode(args[1])
Expand Down

0 comments on commit bc69abc

Please sign in to comment.