Skip to content

Commit 911fb13

Browse files
committed
hotifx/on_open
dont call self.emit on_open event, may cause issues with a real internal bus in hivemind context self.emit(Message("ovos.session.sync")) is not needed
1 parent f8ca77e commit 911fb13

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

hivemind_bus_client/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ def connect(self, bus=FakeBus(), protocol=None, site_id=None):
188188
self.protocol.bind(bus)
189189
self.wait_for_handshake()
190190

191+
def on_open(self, *args):
192+
"""
193+
Handle the "open" event from the websocket.
194+
A Basic message with the name "open" is forwarded to the emitter.
195+
"""
196+
LOG.debug("Connected")
197+
self.connected_event.set()
198+
self.emitter.emit("open")
199+
# Restore reconnect timer to 5 seconds on sucessful connect
200+
self.retry = 5
201+
191202
def on_error(self, *args):
192203
self.handshake_event.clear()
193204
self.crypto_key = None

0 commit comments

Comments
 (0)