Skip to content

Commit

Permalink
OLDInfo: added verify parameter to plugin, to disable certificate che…
Browse files Browse the repository at this point in the history
…cks due to temporary certificate error of endpoint
  • Loading branch information
psilo909 committed Sep 15, 2023
1 parent 95dcfbd commit 278e809
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions odlinfo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ odlinfo:
class_name: ODLInfo
class_path: plugins.odlinfo
cycle: 3600
verify: True
```
### items.yaml
Expand Down
5 changes: 3 additions & 2 deletions odlinfo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import cherrypy

class ODLInfo(SmartPlugin):
PLUGIN_VERSION = "1.5.2"
PLUGIN_VERSION = "1.5.3"
_base_url = 'https://www.imis.bfs.de/ogc/opendata/ows'

def __init__(self, sh, *args, **kwargs):
Expand All @@ -55,6 +55,7 @@ def __init__(self, sh, *args, **kwargs):
if not self.init_webinterface(WebInterface):
self._init_complete = False
self._cycle = self.get_parameter_value('cycle')
self._verify = self.get_parameter_value('verify')
self._stations = []
self._items = {}
self._update_timestamp = None
Expand Down Expand Up @@ -88,7 +89,7 @@ def _get_stations(self):
"""
try:
parameters = "service=WFS&version=1.1.0&request=GetFeature&typeName=opendata:odlinfo_odl_1h_latest&outputFormat=application/json&sortBy=plz"
response = self._session.get(self._build_url(parameters))
response = self._session.get(self._build_url(parameters), verify=self._verify)
self._update_timestamp = self.shtime.now()

except Exception as e:
Expand Down
8 changes: 7 additions & 1 deletion odlinfo/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugin:
documentation: https://smarthomeng.de/user/plugins_doc/config/odlinfo.html
support: https://knx-user-forum.de/node/986480

version: 1.5.2 # Plugin version
version: 1.5.3 # Plugin version
sh_minversion: 1.6 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: False # plugin supports multi instance
Expand All @@ -27,6 +27,12 @@ parameters:
description:
de: '(optional) Zeit zwischen zwei Updateläufen. Default ist 3600 Sekunden.'
en: '(optional) Time period between two update cycles. Default is 3600 seconds.'
verify:
type: bool
default: True
description:
de: 'Schaltet die Prüfung der Zertifikate des odlinfo Endpunkts ab.'
en: 'Removes certificate validation of the odlinfo endpoint.'

item_attributes:
# Definition of item attributes defined by this plugin
Expand Down

0 comments on commit 278e809

Please sign in to comment.