Merge pull request #51 from dirkhh/fixes

Fixes
Merge pull request #51 into version 0.6.51
Improve energy use estimates for dates prior to very late August '13

Before then we only recorded charge state while we were charging - which means
if streaming data is missing the charge data give very misleading results for
energy used. By making sure that we don't take the next day's values for the
end of intervall computation we make the incorrect results at least somewhat
more realistic.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simpify stats code

The same identical block of code is needed twice -> that should be in a
function for consistency and maintainability.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First cut at weekly data

So far only from streaming, and only logging to console.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Finish adding weekly statistics

These make the issues around accuracy so much more obvious. But since our data
isn't any better, there's not much we can do...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add minimal profiling for stats

This shows just how much time we spend on the database query and later
processing.

I was hoping to be able to skip the sort step if the data is already sorted and
found out that it frequently isn't, even if the user hasn't touched the
database. The data appears to arrive out of order from Tesla.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix incorrect week number calculation (for US)

With this weeks start on Sunday and the correct "first day of week" is used to
visualize the data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Better labels for the weekly stats

And change the title of the page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add tooltips for weekly chart

And remove unused code from the tooltip for daily chart.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
better handling of wake_up calls

inserted a delay when calling wake_up to avoid spamming TESLA with too
many wakeup requests
Version 0.6.52

Better handling of 5.0 firmware in streaming.js to avoid makeing too
many requests during wakeup sequence.
Merge pull request #52 from dirkhh/weeklyStats

Weekly stats
Merge pull reuest #52 into version 0.6.53
Don't access the ts member if there is no entry

This fixes a failure reported by CanuckS#69

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix map screen

This has been broken for a week and no one noticed...

commit 13a58ac906cf ("Restyle trip tracking page") removed one critically
important styling element from the container div into which the map gets
rendered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>