Skip to content

Commit

Permalink
events
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 28, 2023
1 parent f27fde3 commit 6a7eee9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ovos_bus_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from typing import Optional, List, Tuple, Union, Iterable
from uuid import uuid4

from ovos_bus_client.message import dig_for_message, Message
from ovos_config.config import Configuration
from ovos_config.locale import get_default_lang
from ovos_utils.log import LOG, log_deprecation

from ovos_bus_client.message import dig_for_message, Message


class UtteranceState(str, enum.Enum):
INTENT = "intent" # includes converse
Expand Down Expand Up @@ -512,6 +511,21 @@ class SessionManager:
default_session: Session = Session("default")
__lock = Lock()
sessions = {"default": default_session}
bus = None

@classmethod
def sync(cls):
cls.bus.emit(Message("ovos.session.update_default",
{"session_data": cls.default_session.serialize()}))

@classmethod
def connect_to_bus(cls, bus):
cls.bus = bus
cls.sync()

@classmethod
def handle_default_session_request(cls, message):
cls.sync()

@staticmethod
def prune_sessions():
Expand Down

0 comments on commit 6a7eee9

Please sign in to comment.