Skip to content

Commit

Permalink
Release v1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Aug 12, 2017
1 parent 86fd230 commit 5a17ab3
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 44 deletions.
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ Please make sure you have a fresh **database backup** before upgrading! Upgradin



v1.8.2 - 2017-08-12
^^^^^^^^^^^^^^^^^^^

**Tickets resolved in this release:**

- [`#346 <https://github.com/dennissiemensma/dsmr-reader/issues/346>`_] Defer statistics page XHR



v1.8.1 - 2017-07-04
^^^^^^^^^^^^^^^^^^^

Expand Down
88 changes: 49 additions & 39 deletions dsmr_frontend/templates/dsmr_frontend/statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,6 @@
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="panel">
<header class="panel-heading">
{% trans "Telegram readings" %}
</header>
<div class="panel-body">
<table class="table table-condensed">
<tr>
<td class="col-md-6">
{% trans "Total reading count" %} <small>
<br />
{% blocktrans %}The number of P1 DSMR telegrams read and stored in the application.{% endblocktrans %}</small>
</td>
<td class="col-md-6">
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader"></i>
<span class="badge bg-black xhr-hidden">
<span id="total_reading_count"></span>
</span>
</td>
</tr>
{% if meter_statistics.rejected_telegrams %}
<tr>
<td>{% trans "Number of rejected telegrams due to invalid CRC checksum" %}</td>
<td><span class="badge bg-black">{{ meter_statistics.rejected_telegrams|default:'-' }}</span></td>
</tr>
{% endif %}
</table>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="panel">
Expand Down Expand Up @@ -146,7 +113,41 @@
</div>
</div>
</div>


<div class="row">
<div class="col-md-12">
<div class="panel">
<header class="panel-heading">
{% trans "Telegram readings" %}
</header>
<div class="panel-body">
<table class="table table-condensed">
<tr>
<td class="col-md-6">
{% trans "Total reading count" %} <small>
<br />
{% blocktrans %}The number of P1 DSMR telegrams read and stored in the application.{% endblocktrans %}</small>
</td>
<td class="col-md-6 ">
<a class="btn btn-primary trigger-extra-statistics" href="#"><i class="fa fa-refresh"></i> &nbsp; {% trans 'Show' %}</a>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader hidden"></i>
<span class="badge bg-black xhr-hidden">
<span id="total_reading_count"></span>
</span>
</td>
</tr>
{% if meter_statistics.rejected_telegrams %}
<tr>
<td>{% trans "Number of rejected telegrams due to invalid CRC checksum" %}</td>
<td><span class="badge bg-black">{{ meter_statistics.rejected_telegrams|default:'-' }}</span></td>
</tr>
{% endif %}
</table>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="panel">
Expand All @@ -162,7 +163,8 @@
{% blocktrans %}Average calculated among the top five most common electricity consumption read. This might also be the (minimum) constant electricity consumption in your home.{% endblocktrans %}</small>
</td>
<td class="col-md-6">
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader"></i>
<a class="btn btn-primary trigger-extra-statistics" href="#"><i class="fa fa-refresh"></i> &nbsp; {% trans 'Show' %}</a>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader hidden"></i>
<span class="badge bg-red xhr-hidden">
<i class="fa fa-bolt"></i> &nbsp; <span id="slumber_consumption_watt"></span> &nbsp; {% trans "Watt" %}
</span>
Expand All @@ -171,7 +173,8 @@
<tr>
<td>{% trans "Lowest electricity consumption read" %}</td>
<td>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader"></i>
<a class="btn btn-primary trigger-extra-statistics" href="#"><i class="fa fa-refresh"></i> &nbsp; {% trans 'Show' %}</a>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader hidden"></i>
<span class="badge bg-red xhr-hidden">
<i class="fa fa-bolt"></i> &nbsp; <span id="min_consumption_watt"></span> &nbsp; {% trans "Watt" %}
</span>
Expand All @@ -180,7 +183,8 @@
<tr>
<td>{% trans "Highest electricity consumption read" %}</td>
<td>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader"></i>
<a class="btn btn-primary trigger-extra-statistics" href="#"><i class="fa fa-refresh"></i> &nbsp; {% trans 'Show' %}</a>
<i class="fa fa-spinner fa-pulse fa-fw xhr-loader hidden"></i>
<span class="badge bg-red xhr-hidden">
<i class="fa fa-bolt"></i> &nbsp; <span id="max_consumption_watt"></span> &nbsp; {% trans "Watt" %}
</span>
Expand Down Expand Up @@ -241,11 +245,17 @@
<script type="text/javascript">

$(document).ready(function(){
fetch_xhr_data();
$('.trigger-extra-statistics').click(function(){
$('.trigger-extra-statistics').hide();
fetch_xhr_data();
return false;
})
});

function fetch_xhr_data()
{
$(".xhr-loader").removeClass("hidden").show();

$.ajax({
dataType: "json",
url: "{% url 'frontend:statistics-xhr-data' %}",
Expand All @@ -257,7 +267,7 @@
$("#min_consumption_watt").html(response.min_consumption_watt);
$("#max_consumption_watt").html(response.max_consumption_watt);

$(".xhr-hidden").show();
$(".xhr-hidden").show();
});
}

Expand Down
3 changes: 1 addition & 2 deletions dsmr_frontend/views/trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def get_context_data(self, **kwargs):

context_data['electricity_by_tariff_month'] = dsmr_stats.services.\
electricity_tariff_percentage(start_date=now.date() - relativedelta(months=1))
print(context_data['electricity_by_tariff_week'])
print(context_data['electricity_by_tariff_month'])

graph_data = defaultdict(list)

for current in average_consumption_by_hour:
Expand Down
2 changes: 1 addition & 1 deletion dsmrreader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
from django.utils.version import get_version


VERSION = (1, 8, 1, 'final', 0)
VERSION = (1, 8, 2, 'final', 0)

__version__ = get_version(VERSION)
Binary file modified dsmrreader/locales/nl/LC_MESSAGES/django.mo
Binary file not shown.
7 changes: 5 additions & 2 deletions dsmrreader/locales/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ msgstr "Geleverd"
msgid "Gas "
msgstr "Gas"

msgid "Meter statistics"
msgstr "Meterstatistieken"

msgid "Telegram readings"
msgstr "Telegram-metingen"

Expand All @@ -718,8 +721,8 @@ msgstr "Totaal aantal metingen"
msgid "The number of P1 DSMR telegrams read and stored in the application."
msgstr "Het aantal P1 DSMR telegram-metingen die opgeslagen zijn."

msgid "Meter statistics"
msgstr "Meterstatistieken"
msgid "Show"
msgstr "Toon"

msgid "Usage statistics"
msgstr "Verbruiksstatistieken"
Expand Down

0 comments on commit 5a17ab3

Please sign in to comment.