Update frontend (#5652)

* Return empty result when history date is in future

* Update frontend
This commit is contained in:
Paulus Schoutsen
2017-01-30 09:12:07 -08:00
committed by GitHub
parent 87764a51ba
commit 55992468b0
11 changed files with 14 additions and 9 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
FINGERPRINTS = {
"core.js": "40a73d7be324cb52fbba55d993db126c",
"frontend.html": "e530d966406fcb2fddb692842dc83c1b",
"frontend.html": "d3e11787b7487dfe95a957ff029ae2a2",
"mdi.html": "7a0f14bbf3822449f9060b9c53bd7376",
"micromarkdown-js.html": "93b5ec4016f0bba585521cf4d18dec1a",
"panels/ha-panel-dev-event.html": "5c82300b3cf543a92cf4297506e450e7",
@@ -10,9 +10,9 @@ FINGERPRINTS = {
"panels/ha-panel-dev-service.html": "9f749635e518a4ca7991975bdefdb10a",
"panels/ha-panel-dev-state.html": "041f5b660f7a1fa748e47fc46c0bdb3c",
"panels/ha-panel-dev-template.html": "97f77b69faef8c5975c09431912831cc",
"panels/ha-panel-history.html": "44e463708a54cb6243dea42d0e173c4a",
"panels/ha-panel-history.html": "8955c1d093a2c417c89ed90dd627c7d3",
"panels/ha-panel-iframe.html": "d920f0aa3c903680f2f8795e2255daab",
"panels/ha-panel-logbook.html": "0e8ea21b5f515a315b7952e396c84280",
"panels/ha-panel-logbook.html": "f36297a894524518fa70883f264492b0",
"panels/ha-panel-map.html": "9c8c7924ba8f731560c9f4093835cc26",
"websocket_test.html": "575de64b431fe11c3785bf96d7813450"
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6 -1
View File
@@ -221,12 +221,17 @@ class HistoryPeriodView(HomeAssistantView):
if datetime is None:
return self.json_message('Invalid datetime', HTTP_BAD_REQUEST)
now = dt_util.utcnow()
one_day = timedelta(days=1)
if datetime:
start_time = dt_util.as_utc(datetime)
else:
start_time = dt_util.utcnow() - one_day
start_time = now - one_day
if start_time > now:
return self.json([])
end_time = start_time + one_day
entity_id = request.GET.get('filter_entity_id')