Stan Janssen преди 3 години
родител
ревизия
6a3924fa23
променени са 4 файла, в които са добавени 54 реда и са изтрити 94 реда
  1. 0 69
      docs/_static/css/custom.css
  2. 10 3
      docs/conf.py
  3. 29 17
      docs/roadmap.rst
  4. 15 5
      docs/server.rst

+ 0 - 69
docs/_static/css/custom.css

@@ -1,69 +0,0 @@
-@font-face {
-    font-family: 'charter-webfont';
-    src: url('../fonts/charter_regular.woff') format('woff');
-    font-weight: normal;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'charter-webfont';
-    src: url('../fonts/charter_italic.woff') format('woff');
-    font-weight: normal;
-    font-style: italic;
-}
-
-@font-face {
-    font-family: 'charter-webfont';
-    src: url('../fonts/charter_bold.woff') format('woff');
-    font-weight: bold;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'charter-webfont';
-    src: url('../fonts/charter_bold_italic.woff') format('woff');
-    font-weight: bold;
-    font-style: italic;
-}
-
-html{
-    border-top: 5px solid #785b9c;
-    border-bottom: 5px solid #785b9c;
-    min-height: 100vh;
-    box-sizing: border-box;
-}
-
-body {
-    font-family: 'Charter', 'charter-webfont', 'Georgia', sans-serif;
-}
-
-h1, h2, h3 {
-    font-family: 'Charter', 'charter-webfont', 'Georgia', sans-serif;
-}
-
-div.body pre {
-    font-size: 80%;
-}
-
-div.sphinxsidebarwrapper p.logo{
-    margin-bottom: 20px;
-    text-align: left;
-}
-
-div.sphinxsidebarwrapper h1.logo{
-    display: none;
-}
-
-div.body a{
-    color: #785b9c;
-    text-decoration: none;
-    border-bottom: none;
-}
-
-div.body a:hover{
-    color: white;
-    background-color: #785b9c;
-    padding: 0px 2px;
-    margin: 0px -2px;
-    border-radius: 3px;
-}

+ 10 - 3
docs/conf.py

@@ -54,7 +54,15 @@ autoclass_content = 'both'
 # a list of builtin themes.
 #
 html_theme = 'alabaster'
-html_logo = 'logo-tall.png'
+# html_logo = 'logo-tall.png'
+html_theme_options = {
+    'logo': 'logo-tall.png',
+    'logo_name': False,
+    'github_user': 'openleadr',
+    'github_repo': 'openleadr-python',
+    'font_family': 'sans-serif',
+    'font_size': 8
+}
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
@@ -62,5 +70,4 @@ html_logo = 'logo-tall.png'
 html_static_path = ['_static']
 
 
-def setup(app):
-    app.add_css_file('css/custom.css')  # may also be an URL
+

+ 29 - 17
docs/roadmap.rst

@@ -20,10 +20,22 @@ Version Main features                      Target timeframe
 Changelog
 ---------
 
+openleadr 0.5.17
+~~~~~~~~~~~~~~~~
+
+Released: 5 January 2021
+
+Bug fixes:
+
+- reportRequestID is now correctly set to 0 in the oadrRegisterReport message
+- The Content-Type header is now correctly set on all VEN requests, and the VTN will check for it.
+- x-LoadrControlPercentOffset contained a typo
+- The oadrRegisterReport reportDescription would contain an invalid default MarketContext, which is now fixed
+
 openleadr 0.5.16
 ~~~~~~~~~~~~~~~~
 
-Released: 15 december 2020
+Released: 15 December 2020
 
 Bug fixes:
 
@@ -35,7 +47,7 @@ Bug fixes:
 openleadr 0.5.15
 ~~~~~~~~~~~~~~~~
 
-Released: 15 december 2020
+Released: 15 December 2020
 
 Bug fixes:
 
@@ -50,7 +62,7 @@ New features:
 openleadr 0.5.14
 ~~~~~~~~~~~~~~~~
 
-Released: 15 december 2020
+Released: 15 December 2020
 
 New features:
 
@@ -75,7 +87,7 @@ Other changes:
 openleadr 0.5.13
 ~~~~~~~~~~~~~~~~
 
-Released: 10 december 2020
+Released: 10 December 2020
 
 New features:
 
@@ -89,7 +101,7 @@ Bug fixes:
 openleadr 0.5.12
 ~~~~~~~~~~~~~~~~
 
-Released: 10 december 2020
+Released: 10 December 2020
 
 New features:
 
@@ -108,7 +120,7 @@ Bug fixes:
 openleadr 0.5.11
 ~~~~~~~~~~~~~~~~
 
-Released: 3 december 2020
+Released: 3 December 2020
 
 New features:
 
@@ -129,7 +141,7 @@ Changes:
 openleadr 0.5.10
 ~~~~~~~~~~~~~~~~
 
-Released: 1 december 2020
+Released: 1 December 2020
 
 Bug fixes:
 
@@ -138,7 +150,7 @@ Bug fixes:
 openleadr 0.5.9
 ~~~~~~~~~~~~~~~
 
-Released: 1 december 2020
+Released: 1 December 2020
 
 New features:
 
@@ -153,7 +165,7 @@ Bug fixes:
 openleadr 0.5.8
 ~~~~~~~~~~~~~~~
 
-Released: 30 november 2020
+Released: 30 November 2020
 
 New features:
 
@@ -163,7 +175,7 @@ New features:
 openleadr 0.5.7
 ~~~~~~~~~~~~~~~
 
-Released: 27 november 2020
+Released: 27 November 2020
 
 Bugs fixed:
 
@@ -172,7 +184,7 @@ Bugs fixed:
 openleadr 0.5.5
 ~~~~~~~~~~~~~~~
 
-Released: 23 november 2020
+Released: 23 November 2020
 
 New features:
 
@@ -182,7 +194,7 @@ New features:
 openleadr 0.5.4
 ~~~~~~~~~~~~~~~
 
-Released: 23 november 2020
+Released: 23 November 2020
 
 New features:
 
@@ -192,7 +204,7 @@ New features:
 openleadr 0.5.3
 ~~~~~~~~~~~~~~~
 
-Released: 20 november 2020
+Released: 20 November 2020
 
 New features:
 
@@ -203,7 +215,7 @@ New features:
 openleadr 0.5.2
 ~~~~~~~~~~~~~~~
 
-Released: 19 november 2020
+Released: 19 November 2020
 
 
 Bug fixes:
@@ -218,7 +230,7 @@ Known issues:
 openleadr 0.5.1
 ~~~~~~~~~~~~~~~
 
-Released: 19 november 2020
+Released: 19 November 2020
 
 New features:
 
@@ -238,7 +250,7 @@ Known issues:
 openleadr 0.5.0
 ~~~~~~~~~~~~~~~
 
-Released: 16 november 2020
+Released: 16 November 2020
 
 First release to pypi.org.
 
@@ -249,7 +261,7 @@ New features:
 openleadr 0.4.0
 ~~~~~~~~~~~~~~~
 
-Released: 16 november 2020
+Released: 16 November 2020
 
 Only released to git.
 

+ 15 - 5
docs/server.rst

@@ -19,7 +19,10 @@ VEN.
 
     import asyncio
     from datetime import datetime, timezone, timedelta
-    from openleadr import OpenADRServer
+    from openleadr import OpenADRServer, enable_default_logging
+    from functools import partial
+
+    enable_default_logging()
 
     async def on_create_party_registration(registration_info):
         """
@@ -48,6 +51,12 @@ VEN.
         for time, value in data:
             print(f"Ven {ven_id} reported {measurement} = {value} at time {time} for resource {resource_id}")
 
+    async def event_response_callback(ven_id, event_id, opt_type):
+        """
+        Callback that receives the response from a VEN to an Event.
+        """
+        print(f"VEN {ven_id} responded to Event {event_id} with: {opt_type}")
+
     # Create the server object
     server = OpenADRServer(vtn_id='myvtn')
 
@@ -59,11 +68,12 @@ VEN.
 
     # Add a prepared event for a VEN that will be picked up when it polls for new messages.
     server.add_event(ven_id='ven_id_123',
-                     event_name='simple',
-                     event_type='level',
+                     signal_name='simple',
+                     signal_type='level',
                      intervals=[{'dtstart': datetime(2021, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
                                  'duration': timedelta(minutes=10),
-                                 'signal_payload': 1}])
+                                 'signal_payload': 1}],
+                     callback=event_response_callback)
 
     # Run the server on the asyncio event loop
     loop = asyncio.get_event_loop()
@@ -226,7 +236,7 @@ If you want to add an event and wait for the response in a single coroutine, you
 
 
 A word on event targets
-~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------
 
 The Target of your Event is an indication for the VEN which resources or devices should be affected. You can supply the target of the event in serveral ways: