Skip to content

Commit

Permalink
Release of v1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Jun 12, 2018
1 parent 97b95fd commit 4d934b4
Show file tree
Hide file tree
Showing 43 changed files with 753 additions and 132 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ omit = ./*/__init__.py
./*/tests/*
./*/migrations/*
./dsmr_backend/mixins.py
./dsmr_plugins/modules/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/backups/
/logs/
/.coverage
/dsmr_plugins/modules/
44 changes: 37 additions & 7 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -637,18 +637,48 @@ Example
"total_cost": 0.9,
}


----
----

``GET`` - ``statistics/hour``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Retrieves any **aggregated hourly statistics**. Please note that these are generated a few hours **after midnight**.


``GET`` - ``consumption/electricity-live``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Returns the live electricity consumption, containing the same data as the Dashboard header.


URI
~~~
Full path: ``/api/v2/consumption/electricity-live``


Parameters
~~~~~~~~~~
None.


Response
~~~~~~~~
``HTTP 200`` on success. Body contains the result(s) in JSON format. Any other status code on failure.


Example
~~~~~~~

**Note**: ``cost_per_hour`` is only available when you've set energy prices.

**Data structure returned**::

{
"timestamp": "2016-07-01T20:00:00Z",
"currently_returned": 0,
"currently_delivered":1123,
"cost_per_hour": 0.02,
}


----


``GET`` - ``statistics/day``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Retrieves any **aggregated day statistics**. Please note that these are generated a few hours **after midnight**.
Expand Down
12 changes: 12 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ Please make sure you have a fresh **database backup** before upgrading! Upgradin



v1.19.0 - 2018-06-12
^^^^^^^^^^^^^^^^^^^^

**Tickets resolved in this release:**

- [`#390 <https://github.com/dennissiemensma/dsmr-reader/issues/390>`_] Gas- en elektriciteitsverbruik vanaf start energie contract
- [`#482 <https://github.com/dennissiemensma/dsmr-reader/issues/482>`_] Aantal items op X-as in dashboardgrafiek variabel maken
- [`#407 <https://github.com/dennissiemensma/dsmr-reader/issues/407>`_] Plugin System (More than one pvoutput account)
- [`#462 <https://github.com/dennissiemensma/dsmr-reader/issues/462>`_] Get live usage trough API



v1.18.0 - 2018-06-05
^^^^^^^^^^^^^^^^^^^^

Expand Down
Binary file modified docs/locale/nl/LC_MESSAGES/api.mo
Binary file not shown.
93 changes: 61 additions & 32 deletions docs/locale/nl/LC_MESSAGES/api.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ msgstr ""
"Project-Id-Version: DSMR Reader v1.x\n"
"Report-Msgid-Bugs-To: Dennis Siemensma <github@dennissiemensma.nl>\n"
"Last-Translator: Dennis Siemensma <github@dennissiemensma.nl>\n"
"Language: nl\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"
"Language: nl\n"
"Generated-By: Babel 2.5.1\n"
"X-Generator: Poedit 1.8.7.1\n"

#: ../../api.rst:2
Expand All @@ -29,6 +30,10 @@ msgstr ""
"De applicatie heeft een API waarmee metingen kunt aanmaken/opvragen en diverse "
"statistieken uitlezen."

#: ../../api.rst:7
msgid "Contents"
msgstr "Inhoudsopgave"

#: ../../api.rst:10
msgid "Configuration & authentication"
msgstr "Configuratie & authenticatie"
Expand All @@ -46,7 +51,7 @@ msgstr ""
"in het configuratiescherm of beheerderpaneel."

#: ../../api.rst:18 ../../api.rst:79 ../../api.rst:332 ../../api.rst:623
#: ../../api.rst:679 ../../api.rst:739
#: ../../api.rst:665 ../../api.rst:709 ../../api.rst:769
msgid "Example"
msgstr "Voorbeeld"

Expand Down Expand Up @@ -111,7 +116,7 @@ msgstr ""
"``HTTP 200``, wanneer succesvol."

#: ../../api.rst:63 ../../api.rst:301 ../../api.rst:406 ../../api.rst:608
#: ../../api.rst:658 ../../api.rst:718
#: ../../api.rst:650 ../../api.rst:688 ../../api.rst:748
msgid "URI"
msgstr "URI"

Expand All @@ -120,7 +125,7 @@ msgid "Full path: ``/api/v1/datalogger/dsmrreading``"
msgstr "Volledig pad: ``/api/v1/datalogger/dsmrreading``"

#: ../../api.rst:68 ../../api.rst:306 ../../api.rst:411 ../../api.rst:613
#: ../../api.rst:663 ../../api.rst:723
#: ../../api.rst:655 ../../api.rst:693 ../../api.rst:753
msgid "Parameters"
msgstr "Parameters"

Expand All @@ -133,7 +138,7 @@ msgstr ""
"regeleindes ``\\n`` en 'carriage returns' ``\\r``."

#: ../../api.rst:74 ../../api.rst:327 ../../api.rst:422 ../../api.rst:618
#: ../../api.rst:674 ../../api.rst:734
#: ../../api.rst:660 ../../api.rst:704 ../../api.rst:764
msgid "Response"
msgstr "Respons (van de server)"

Expand Down Expand Up @@ -395,7 +400,7 @@ msgstr ""
"Haalt opgeslagen metingen op. De metingen komen ofwel voort uit telegrammen of "
"zijn handmatig aangemaakt via deze API."

#: ../../api.rst:412 ../../api.rst:664 ../../api.rst:724
#: ../../api.rst:412 ../../api.rst:694 ../../api.rst:754
msgid "All parameters are optional."
msgstr "Alle parameters zijn optioneel."

Expand Down Expand Up @@ -424,23 +429,24 @@ msgstr ""
"Laat de parameter weg of gebruik ``timestamp`` om **oplopend** te sorteren "
"(standaard)."

#: ../../api.rst:417 ../../api.rst:669 ../../api.rst:729
#: ../../api.rst:417 ../../api.rst:699 ../../api.rst:759
msgid ""
"``offset`` (*integer*) - When iterating large resultsets, the offset "
"determines the starting point."
msgstr ""
"``offset`` (*integer*) - Bij het doorlopen van vele resultaten kun je hiermee "
"het startpunt bepalen."

#: ../../api.rst:418 ../../api.rst:670 ../../api.rst:730
#: ../../api.rst:418 ../../api.rst:700 ../../api.rst:760
msgid ""
"``limit`` (*integer*) - Limits the resultset size returned. Omit for "
"maintaining the default limit (**25**)."
msgstr ""
"``limit`` (*integer*) - Beperkt het aantal resultaten dat teruggegeven wordt. "
"Laat deze parameter weg voor de standaardwaarde (**25**)."

#: ../../api.rst:423 ../../api.rst:619 ../../api.rst:675 ../../api.rst:735
#: ../../api.rst:423 ../../api.rst:619 ../../api.rst:661 ../../api.rst:705
#: ../../api.rst:765
msgid ""
"``HTTP 200`` on success. Body contains the result(s) in JSON format. Any other "
"status code on failure."
Expand Down Expand Up @@ -506,97 +512,120 @@ msgstr "Geeft het verbruik (tot nu toe) van de huidige dag terug."

#: ../../api.rst:609
msgid "Full path: ``/api/v2/consumption/today``"
msgstr "Volledig pad:``/api/v2/consumption/today``"
msgstr "Volledig pad: ``/api/v2/consumption/today``"

#: ../../api.rst:614
#: ../../api.rst:614 ../../api.rst:656
msgid "None."
msgstr "Geen."

#: ../../api.rst:625 ../../api.rst:682 ../../api.rst:742
#: ../../api.rst:625 ../../api.rst:669 ../../api.rst:712 ../../api.rst:772
msgid "**Data structure returned**::"
msgstr "**Datastructuur**::"

#: ../../api.rst:645 ../../api.rst:713
msgid "``GET`` - ``statistics/hour``"
msgstr "``GET`` - ``statistics/hour``"
#: ../../api.rst:645
msgid "``GET`` - ``consumption/electricity-live``"
msgstr "``GET`` - ``consumption/electricity-live``"

#: ../../api.rst:646 ../../api.rst:714
#: ../../api.rst:646
msgid ""
"Retrieves any **aggregated hourly statistics**. Please note that these are "
"generated a few hours **after midnight**."
"Returns the live electricity consumption, containing the same data as the "
"Dashboard header."
msgstr ""
"Haalt **geaggregeerde uurstatistieken** op. Deze worden elke dag een paar uur "
"**ná middernacht** gegenereerd."
"Geeft het live elektriciteitsverbruik terug, feitelijk dezelfde gegevens als "
"rechtsbovenin het Dashboard."

#: ../../api.rst:651
msgid "Full path: ``/api/v2/consumption/electricity-live``"
msgstr "Volledig pad: ``/api/v2/consumption/electricity-live``"

#: ../../api.rst:653
#: ../../api.rst:667
msgid ""
"**Note**: ``cost_per_hour`` is only available when you've set energy prices."
msgstr ""
"**N.B.**: ``cost_per_hour`` is alleen beschikbaar wanneer je energieprijzen "
"hebt ingesteld."

#: ../../api.rst:683
msgid "``GET`` - ``statistics/day``"
msgstr "``GET`` - ``statistics/day``"

#: ../../api.rst:654
#: ../../api.rst:684
msgid ""
"Retrieves any **aggregated day statistics**. Please note that these are "
"generated a few hours **after midnight**."
msgstr ""
"Haalt **geaggregeerde dagstatistieken** op. Deze worden elke dag een paar uur "
"**ná middernacht** gegenereerd."

#: ../../api.rst:659
#: ../../api.rst:689
msgid "Full path: ``/api/v2/statistics/day``"
msgstr "Volledig pad: ``/api/v2/statistics/day``"

#: ../../api.rst:666
#: ../../api.rst:696
msgid ""
"``day__gte`` (*date*) - Limits the result to any statistics having their date "
"**higher or equal** to this parameter."
msgstr ""
"``day__gte`` (*date*) - Beperkt het resultaat tot alle datums die **hoger of "
"gelijk zijn aan** deze parameter."

#: ../../api.rst:667
#: ../../api.rst:697
msgid ""
"``day__lte`` (*date*) - Limits the result to any statistics having their date "
"**lower or equal** to this parameter."
msgstr ""
"``day__lte`` (*date*) - Beperkt het resultaat tot alle datums die **lager of "
"gelijk zijn aan** deze parameter."

#: ../../api.rst:668
#: ../../api.rst:698
msgid ""
"``ordering`` (*string*) - Use ``-day`` to sort **descending**. Omit or use "
"``day`` to sort **ascending** (default)."
msgstr ""
"``ordering`` (*string*) - Gebruik ``-day`` om **aflopend** te sorteren. Laat "
"de parameter weg of gebruik ``day`` om **oplopend** te sorteren (standaard)."

#: ../../api.rst:680 ../../api.rst:740
#: ../../api.rst:710 ../../api.rst:770
msgid ""
"All the :ref:`generic DSMRREADING examples <generic-examples-anchor>` apply "
"here as well, since only the ``timestamp`` field differs."
msgstr ""
"Alle :ref:`generieke DSMRREADING voorbeelden <generic-examples-anchor>` zijn "
"hier tevens van toepassing, gezien alleen het ``timestamp`` field afwijkt."

#: ../../api.rst:719
#: ../../api.rst:743
msgid "``GET`` - ``statistics/hour``"
msgstr "``GET`` - ``statistics/hour``"

#: ../../api.rst:744
msgid ""
"Retrieves any **aggregated hourly statistics**. Please note that these are "
"generated a few hours **after midnight**."
msgstr ""
"Haalt **geaggregeerde uurstatistieken** op. Deze worden elke dag een paar uur "
"**ná middernacht** gegenereerd."

#: ../../api.rst:749
msgid "Full path: ``/api/v2/statistics/hour``"
msgstr "Volledig pad: ``/api/v2/statistics/hour``"

#: ../../api.rst:726
#: ../../api.rst:756
msgid ""
"``hour_start__gte`` (*datetime*) - Limits the result to any statistics having "
"their datetime (hour start) **higher or equal** to this parameter."
msgstr ""
"``hour_start__gte`` (*datetime*) - Beperkt het resultaat tot alle "
"(datum)tijdstippen die **hoger of gelijk zijn aan** deze parameter."

#: ../../api.rst:727
#: ../../api.rst:757
msgid ""
"``hour_start__lte`` (*datetime*) - Limits the result to any statistics having "
"their datetime (hour start) **lower or equal** to this parameter."
msgstr ""
"``hour_start__lte`` (*datetime*) - Beperkt het resultaat tot alle "
"(datum)tijdstippen die **lager of gelijk zijn aan** deze parameter."

#: ../../api.rst:728
#: ../../api.rst:758
msgid ""
"``ordering`` (*string*) - Use ``-hour_start`` to sort **descending**. Omit or "
"use ``hour_start`` to sort **ascending** (default)."
Expand Down
53 changes: 53 additions & 0 deletions dsmr_api/fixtures/dsmr_api/test_live.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[
{
"fields": {
"electricity_delivered_1": "528.750",
"extra_device_timestamp": "2016-07-01T18:00:00Z",
"extra_device_delivered": "845.888",
"electricity_returned_2": "123.456",
"electricity_currently_delivered": "0.247",
"timestamp": "2016-07-01T18:00:00Z",
"electricity_returned_1": "0.456",
"electricity_currently_returned": "0.123",
"processed": false,
"electricity_delivered_2": "525.500"
},
"model": "dsmr_datalogger.dsmrreading",
"pk": 1
},
{
"fields": {
"electricity_delivered_1": "529.750",
"extra_device_timestamp": "2016-07-01T19:00:00Z",
"extra_device_delivered": "845.898",
"electricity_returned_2": "123.567",
"electricity_currently_delivered": "0.750",
"timestamp": "2016-07-01T19:00:00Z",
"electricity_returned_1": "0.567",
"electricity_currently_returned": "0.123",
"processed": false,
"electricity_delivered_2": "527.500"
},
"model": "dsmr_datalogger.dsmrreading",
"pk": 2
},
{
"fields": {
"electricity_delivered_1": "530.750",
"extra_device_timestamp": "2016-07-01T20:00:00Z",
"extra_device_delivered": "845.898",
"electricity_returned_2": "123.678",
"electricity_currently_delivered": "1.123",
"timestamp": "2016-07-01T20:00:00Z",
"electricity_returned_1": "0.678",
"electricity_currently_returned": "0.123",
"processed": false,
"electricity_delivered_2": "528.500",
"phase_currently_delivered_l1": "0.123",
"phase_currently_delivered_l2": "0.456",
"phase_currently_delivered_l3": "0.789"
},
"model": "dsmr_datalogger.dsmrreading",
"pk": 3
}
]
Loading

0 comments on commit 4d934b4

Please sign in to comment.