Skip to content

Commit 03da1f7

Browse files
Changes necessary to recreate video streaming bug
1 parent 98e63c3 commit 03da1f7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/oshconnect/oshconnectapi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import json
99
from uuid import UUID
1010

11-
from eventbus import EventHandler
1211
from .csapi4py.default_api_helpers import APIHelper
1312
from .datastore import DataStore
1413
from .resource_datamodels import DatastreamResource
@@ -32,7 +31,6 @@ class OSHConnect:
3231
_tasks: list = []
3332
_playback_mode: TemporalModes = TemporalModes.REAL_TIME
3433
_session_manager: SessionManager = None
35-
_event_bus: EventHandler = None
3634

3735
def __init__(self, name: str, **kwargs):
3836
"""
@@ -42,7 +40,6 @@ def __init__(self, name: str, **kwargs):
4240
self._name = name
4341
logging.info(f"OSHConnect instance {name} created")
4442
self._session_manager = SessionManager()
45-
self._event_bus = EventHandler()
4643

4744
def get_name(self):
4845
"""
@@ -217,7 +214,7 @@ def find_system(self, system_id: str) -> System | None:
217214
:return: the found system or None if not found
218215
"""
219216
for system in self._systems:
220-
if system.uid == system_id:
217+
if system.urn == system_id:
221218
return system
222219
return None
223220

src/oshconnect/streamableresource.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def _publish_mqtt(self, topic, payload):
539539
if self._mqtt_client is None:
540540
logging.warning(f"No MQTT client configured for streamable resource {self._id}.")
541541
return
542-
print(f'Publishing to MQTT topic {topic}: {payload}')
542+
# print(f'Publishing to MQTT topic {topic}: {payload}')
543543
self._mqtt_client.publish(topic, payload, qos=0)
544544

545545
async def _write_to_mqtt(self):
@@ -940,7 +940,7 @@ def start(self):
940940
print(traceback.format_exc())
941941
print(f"Error starting MQTT write task: {e}")
942942

943-
# self._mqtt_client.start()
943+
# self._mqtt_client.start()i
944944

945945
def init_mqtt(self):
946946
super().init_mqtt()
@@ -959,6 +959,10 @@ def insert(self, data: dict):
959959
encoded = json.dumps(data).encode('utf-8')
960960
self._publish_mqtt(self._topic, encoded)
961961

962+
def insert_bytes(self, data: dict):
963+
print("*** Insert bytes")
964+
self._publish_mqtt(self._topic, data)
965+
962966
def serialize(self) -> dict:
963967
data = super().serialize()
964968
data["should_poll"] = getattr(self, "should_poll", None)

0 commit comments

Comments
 (0)