Skip to content

Commit

Permalink
Validate that away command has option of either away or here
Browse files Browse the repository at this point in the history
  • Loading branch information
Randy Levensalor committed Jan 6, 2013
1 parent 510885f commit 3cf5015
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ def main():
elif (cmd == "curhumid"):
print n.status["device"][n.serial]["current_humidity"]
elif (cmd == "away"):
if len(args)<2 or args[1] not in {"away", "here"}:
print "please specify a state of 'away' or 'here'"
sys.exit(-1)
n.set_away(args[1])
else:
print "misunderstood command:", cmd
Expand Down

0 comments on commit 3cf5015

Please sign in to comment.