Skip to content

Commit 3cc73b3

Browse files
author
Paul Jennings
committed
Fixed command map if file is not present.
1 parent f714cf9 commit 3cc73b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

TStatGcal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ def main(tstatAddr, commandMap=None, username=None, password=None, calName="Ther
152152
query = gdata.calendar.service.CalendarEventQuery()
153153
query.start_min = "%04i-%02i-%02i" % (today.year, today.month, today.day)
154154
query.start_max = "%04i-%02i-%02i" % (tomorrow.year, tomorrow.month, tomorrow.day)
155+
156+
print "start_min:", query.start_min
157+
print "start_max:", query.start_max
155158

156159
# Look for a calendar called calName
157160
feed = calendar_service.GetOwnCalendarsFeed()
@@ -240,7 +243,7 @@ def main(tstatAddr, commandMap=None, username=None, password=None, calName="Ther
240243
value = int(value)
241244
if value >= HEAT_MIN and value <= HEAT_MAX:
242245
print "Setting heat to %s" % int(value)
243-
tstat.setHeatPoint(value)
246+
#tstat.setHeatPoint(value)
244247
else:
245248
print "Value out of acceptable heat range:", value
246249
elif command == 'Cool':
@@ -262,8 +265,8 @@ def main(tstatAddr, commandMap=None, username=None, password=None, calName="Ther
262265
username = f.readline().splitlines()[0]
263266
password = f.readline().splitlines()[0]
264267
f.close()
268+
commandMap = {}
265269
if os.path.isfile(os.path.expanduser("~/.tstat_commands")):
266-
commandMap = {}
267270
f = open(os.path.expanduser("~/.tstat_commands"))
268271
for line in f.readlines():
269272
key, value = line.split(":")

0 commit comments

Comments
 (0)