Skip to content
Snippets Groups Projects
Commit ce80f49b authored by Matthias Stefan Bodenbenner's avatar Matthias Stefan Bodenbenner
Browse files

V10.1.1 fixed bug in stream scheduler and component

parent aae46762
No related branches found
No related tags found
No related merge requests found
Pipeline #445351 passed
[![Build](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/badges/master/pipeline.svg)](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/commits/master)
# Python Unified Device Interface
Current stable version: 10.1.0
Current stable version: 10.1.1
## Installation
1. Install the WZL-UDI package via pip
......@@ -69,6 +69,9 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
## Recent changes
**10.1.1** - 2024-08-16
- added additional flog to Scheduler to configure semantic publishing correctly and supress unnecessary errors and warnings
**10.1.0** - 2024-04-17
- added "advertisement", i.e. publishing of metadata via MQTT every x seconds
- light refactoring of source code for streaming via MQTT
......
......@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(name='wzl-udi',
version='10.1.0',
version='10.1.1',
url='https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python',
project_urls={
"Bug Tracker": "https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python/-/issues",
......
......@@ -334,7 +334,7 @@ class Component(Element):
__import__(module_name)
implementation = getattr(sys.modules[module_name], class_name)(self._implementation._device,
*args, **kwargs)
except AttributeError:
except (AttributeError, ModuleNotFoundError) as e:
module_name = f'hwc.{module_name}'
__import__(module_name)
implementation = getattr(sys.modules[module_name], class_name)(self._implementation._device,
......
......@@ -22,7 +22,7 @@ class StreamScheduler(object):
"""
def __init__(self, loop, schedule: List[Job], publisher: MQTTPublisher = None,
start_immediately: bool = False, dataformat: str = 'json', model: 'Component' = None, advertise: int = 10):
start_immediately: bool = False, dataformat: str = 'json', model: 'Component' = None, advertise: int = 10, semantic: bool = False):
"""Constructor.
Args:
......@@ -41,6 +41,7 @@ class StreamScheduler(object):
self._dataformat: str = dataformat
self._model: Component = model
self._advertise = advertise
self._semantic = semantic
for job in schedule:
if isinstance(job, AdvertisementJob):
......@@ -113,6 +114,7 @@ class StreamScheduler(object):
self._publisher.publish(job.topic, message, 1)
# try to send semantic data package
if self._semantic:
try:
url, semantic_data = job.semantic_data(self._model)
url = url.replace('https://', '').replace('http://', '')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment