Skip to content

Commit

Permalink
Fix for #16
Browse files Browse the repository at this point in the history
Timestamp needs to be in current day, but before 4 AM it shows previous day.  Any time after 4 AM shows all of the current day
  • Loading branch information
PopRe committed May 30, 2018
1 parent 1d4a80c commit d5180b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sense_energy/sense_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ def get_notification_preferences(self):
def get_trend_data(self, scale):
if scale.upper() not in valid_scales:
raise Exception("%s not a valid scale" % scale)
t = datetime.now().replace(hour=12)
response = self.s.get(API_URL + 'app/history/trends?monitor_id=%s&scale=%s&start=%s' %
(self.sense_monitor_id, scale, datetime.now().isoformat()),
(self.sense_monitor_id, scale, t.isoformat()),
headers=self.headers, timeout=API_TIMEOUT)
self._trend_data[scale] = response.json()

Expand Down

0 comments on commit d5180b0

Please sign in to comment.