From 108d9e89f2089cee0c5e2e45edc5f63ecfac2f96 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Sun, 1 May 2016 22:17:00 +0200 Subject: [PATCH 1/3] Fixed new external links to readthedocs.io. --- README.md | 8 ++++---- dsmr_frontend/templates/dsmr_frontend/base.html | 2 +- dsmr_frontend/templates/dsmr_frontend/status.html | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7cb7e87d6..91153f032 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Build Status](https://travis-ci.org/dennissiemensma/dsmr-reader.svg?branch=master)](https://travis-ci.org/dennissiemensma/dsmr-reader) [![Coverage](https://codecov.io/github/dennissiemensma/dsmr-reader/coverage.svg?branch=master)](https://codecov.io/github/dennissiemensma/dsmr-reader?branch=master) [![Requirements Status](https://requires.io/github/dennissiemensma/dsmr-reader/requirements.svg?branch=master)](https://requires.io/github/dennissiemensma/dsmr-reader/requirements/?branch=master) -[![Documentation Status](http://readthedocs.org/projects/dsmr-reader/badge/?version=latest)](http://dsmr-reader.readthedocs.org/en/latest/?badge=latest) +[![Documentation Status](http://readthedocs.org/projects/dsmr-reader/badge/?version=latest)](http://dsmr-reader.readthedocs.io/en/latest/?badge=latest) # About @@ -12,15 +12,15 @@ There are plenty of ‘scripts’ and websites available for performing DSMR rea **English** -See [Read The Docs, in English](http://dsmr-reader.readthedocs.org/en/latest/). Installation guide can be found there as well. +See [Read The Docs, in English](http://dsmr-reader.readthedocs.io/en/latest/). Installation guide can be found there as well. **Dutch / Nederlands** -Zie [Read The Docs, in het Nederlands](http://dsmr-reader.readthedocs.org/nl/latest/). Je kunt daar ook alle installatieinstructies vinden. +Zie [Read The Docs, in het Nederlands](http://dsmr-reader.readthedocs.io/nl/latest/). Je kunt daar ook alle installatieinstructies vinden. # Screenshots -More screenshots can be found in the documentation at [Read The Docs](http://dsmr-reader.readthedocs.org/en/latest/screenshots.html). +More screenshots can be found in the documentation at [Read The Docs](http://dsmr-reader.readthedocs.io/en/latest/screenshots.html). ## Dashboard ![Dashboard](docs/_static/screenshots/dashboard.png) diff --git a/dsmr_frontend/templates/dsmr_frontend/base.html b/dsmr_frontend/templates/dsmr_frontend/base.html index c31d3179c..cf4ffb877 100644 --- a/dsmr_frontend/templates/dsmr_frontend/base.html +++ b/dsmr_frontend/templates/dsmr_frontend/base.html @@ -59,7 +59,7 @@ {% block header_right %}{% endblock %}
  • - + v{{ dsmr_version }}
  • diff --git a/dsmr_frontend/templates/dsmr_frontend/status.html b/dsmr_frontend/templates/dsmr_frontend/status.html index 6bca65549..b2d610a12 100644 --- a/dsmr_frontend/templates/dsmr_frontend/status.html +++ b/dsmr_frontend/templates/dsmr_frontend/status.html @@ -25,11 +25,11 @@ - + - +
    {% trans "Current version" %} {% trans "DSMR-reader" %}v{{ dsmr_version }}v{{ dsmr_version }}
    {% trans "Changelog" %}{% trans 'View all releases' %}{% trans 'View all releases' %}
    From f2cbbd9f44528f0b5ddb1c1dad605986bb6751fe Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Sun, 1 May 2016 22:17:21 +0200 Subject: [PATCH 2/3] Trends page giving errors (when lacking data) #125 --- dsmr_stats/services.py | 5 +++++ dsmr_stats/tests/test_services.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dsmr_stats/services.py b/dsmr_stats/services.py index a0f75911c..773f66779 100644 --- a/dsmr_stats/services.py +++ b/dsmr_stats/services.py @@ -147,6 +147,11 @@ def electricity_tariff_percentage(start_date): electricity1=Sum('electricity1'), electricity2=Sum('electricity2'), ) + + # Empty data will crash. + if not all(totals.values()): + return None + global_total = totals['electricity1'] + totals['electricity2'] totals['electricity1'] = math.ceil(totals['electricity1'] / global_total * 100) totals['electricity2'] = 100 - totals['electricity1'] diff --git a/dsmr_stats/tests/test_services.py b/dsmr_stats/tests/test_services.py index 0ac0080a7..4b16cca8a 100644 --- a/dsmr_stats/tests/test_services.py +++ b/dsmr_stats/tests/test_services.py @@ -296,6 +296,10 @@ def test_electricity_tariff_percentage(self): self.assertEqual(percentages['electricity1'], 25) self.assertEqual(percentages['electricity2'], 75) + # Now try again without data. + DayStatistics.objects.all().delete() + percentages = dsmr_stats.services.electricity_tariff_percentage(start_date=target_date.date()) + class TestServicesWithoutGas(TestServices): fixtures = ['dsmr_stats/electricity-consumption.json'] From 952334b000bda4e92f0c223f911e94601c498f7e Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Sun, 1 May 2016 22:29:09 +0200 Subject: [PATCH 3/3] Prepare release 1.1.2. --- docs/changelog.rst | 5 +++++ docs/credits.rst | 2 ++ dsmrreader/__init__.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a6f0c9cca..5eac3db4e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,11 @@ Changelog ========= +v1.1.2 - 2016-05-01 +^^^^^^^^^^^^^^^^^^^ +- Trends page giving errors (when lacking data) (`#125 `_). + + v1.1.1 - 2016-04-27 ^^^^^^^^^^^^^^^^^^^ - Improve readme (`#124 `_). diff --git a/docs/credits.rst b/docs/credits.rst index d34989de3..d758d99bf 100644 --- a/docs/credits.rst +++ b/docs/credits.rst @@ -39,12 +39,14 @@ Software - `Full Page Screen Capture `_ + Testers & contributors ---------------------- - `Jeroen Peters `_ (`Github profile `_) - `Daniel ter Horst `_ (`Github profile `_) - `Sander de Leeuw `_ (`Github profile `_) +- "WatskeBart" (`Github profile `_) - `Gert Schaafsma `_ - `Bert-Jan Vos `_ diff --git a/dsmrreader/__init__.py b/dsmrreader/__init__.py index 577e96597..f40fedde6 100644 --- a/dsmrreader/__init__.py +++ b/dsmrreader/__init__.py @@ -17,6 +17,6 @@ from django.utils.version import get_version -VERSION = (1, 1, 1, 'final', 0) +VERSION = (1, 1, 2, 'final', 0) __version__ = get_version(VERSION)