Skip to content

Commit a34abf3

Browse files
author
Paul Jennings
committed
Integrated time-handling code from Billy J. West.
1 parent f29c61c commit a34abf3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

API.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,19 @@ class API_CT50v109(API):
145145
{0: 'Off', 1: 'On'}
146146
),
147147
'day': APIEntry(
148-
[('/tstat', 'time/day'), ('/tstat/time/day', 'day')],
148+
#[('/tstat', 'time/day'), ('/tstat/time/day', 'day')],
149+
[('/tstat', 'time/day')],
149150
[],
150-
{1: 'Sunday', 2: 'Monday', 3: 'Tuesday', 4: 'Wednesday', 5: 'Thursday', 6: 'Friday', 7: 'Saturday'}
151+
{0: 'Monday', 1: 'Tuesday', 2: 'Wednesday', 3: 'Thursday', 4: 'Friday', 5: 'Saturday', 6: 'Sunday'}
151152
),
152153
'hour': APIEntry(
153-
[('/tstat', 'time/hour'), ('/tstat/time/hour', 'day')],
154+
#[('/tstat', 'time/hour'), ('/tstat/time/hour', 'day')],
155+
[('/tstat', 'time/hour')],
154156
[]
155157
),
156158
'minute': APIEntry(
157-
[('/tstat', 'time/minute'), ('/tstat/time/minute', 'day')],
159+
#[('/tstat', 'time/minute'), ('/tstat/time/minute', 'day')],
160+
[('/tstat', 'time/minute')],
158161
[]
159162
),
160163
'today_heat_runtime': APIEntry(

TStat.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#Copyright (c) 2011, Paul Jennings <pjennings-tstat@pjennings.net>
44
#All rights reserved.
55

6+
#Contributors:
7+
# Billy J. West
8+
69
#Redistribution and use in source and binary forms, with or without
710
#modification, are permitted provided that the following conditions are met:
811
#
@@ -341,8 +344,7 @@ def getFanState(self, raw=False):
341344

342345
def getTime(self, raw=False):
343346
"""Returns current time."""
344-
# TODO: time processing
345-
pass
347+
return {'day': self._get('day'), 'hour': self._get('hour'), 'minute': self._get('minute')}
346348

347349
def getHeatUsageToday(self, raw=False):
348350
"""Returns heat usage for today."""

0 commit comments

Comments
 (0)