Skip to content

Commit

Permalink
Merge pull request #63 from OpenVoiceOS/release-1.1.0a1
Browse files Browse the repository at this point in the history
Release 1.1.0a1
  • Loading branch information
JarbasAl authored Nov 21, 2024
2 parents da4f11b + 8d672c9 commit e49d422
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 13 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [1.0.1a1](https://github.com/OpenVoiceOS/ovos-gui/tree/1.0.1a1) (2024-11-19)
## [1.1.0a1](https://github.com/OpenVoiceOS/ovos-gui/tree/1.1.0a1) (2024-11-21)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-gui/compare/1.0.0...1.0.1a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-gui/compare/1.0.1...1.1.0a1)

**Merged pull requests:**

- fix:full\_width\_pages [\#60](https://github.com/OpenVoiceOS/ovos-gui/pull/60) ([JarbasAl](https://github.com/JarbasAl))
- feat: forward some events to GUI clients [\#62](https://github.com/OpenVoiceOS/ovos-gui/pull/62) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
71 changes: 67 additions & 4 deletions ovos_gui/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,23 @@
over the GUI message bus.
"""
import shutil
from os.path import join, dirname, isfile, exists
from threading import Event, Lock, Timer
from os.path import join, dirname, exists
from threading import Lock, Timer
from typing import List, Union, Optional, Dict

from ovos_bus_client import Message, MessageBusClient
from ovos_config.config import Configuration
from ovos_utils.log import LOG

from ovos_bus_client import Message, MessageBusClient
from ovos_gui.bus import (
create_gui_service,
determine_if_gui_connected,
get_gui_websocket_config,
send_message_to_gui, GUIWebsocketHandler
)
from ovos_gui.page import GuiPage
from ovos_gui.constants import GUI_CACHE_PATH
from ovos_gui.page import GuiPage

namespace_lock = Lock()

RESERVED_KEYS = ['__from', '__idle']
Expand Down Expand Up @@ -455,6 +456,68 @@ def _define_message_handlers(self):
self.core_bus.on("gui.page_interaction", self.handle_page_interaction)
self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus)
self.core_bus.on("mycroft.gui.screen.close", self.handle_namespace_global_back)
self._define_messages_to_forward()

def _define_messages_to_forward(self):
"""Messages from the core bus to be forwarded to GUI clients."""
messages_to_forward = [
# Audio Service
"recognizer_loop:audio_output_start",
"recognizer_loop:audio_output_end",
# Speech Service
"recognizer_loop:sleep",
"recognizer_loop:wake_up",
"mycroft.awoken",
"recognizer_loop:wakeword",
"recognizer_loop:recognition_unknown",
"recognizer_loop:record_begin",
"recognizer_loop:record_end",
# Enclosure commands for eyes
"enclosure.eyes.on",
"enclosure.eyes.off",
"enclosure.eyes.blink",
"enclosure.eyes.narrow",
"enclosure.eyes.look",
"enclosure.eyes.color",
"enclosure.eyes.level",
"enclosure.eyes.volume",
"enclosure.eyes.spin",
"enclosure.eyes.timedspin",
"enclosure.eyes.reset",
"enclosure.eyes.setpixel",
"enclosure.eyes.fill",
# Enclosure commands for mouth
"enclosure.mouth.events.activate",
"enclosure.mouth.events.deactivate",
"enclosure.mouth.talk",
"enclosure.mouth.think",
"enclosure.mouth.listen",
"enclosure.mouth.smile",
"enclosure.mouth.viseme",
"enclosure.mouth.viseme_list",
# Mouth/matrix display
"enclosure.mouth.reset",
"enclosure.mouth.text",
"enclosure.mouth.display",
"enclosure.weather.display"
]
for msg in messages_to_forward:
self.core_bus.on(msg, self.forward_to_gui)

@staticmethod
def forward_to_gui(message: Message):
"""
Forward a core Message to the GUI
@param message: Core message to forward
"""
gui_message = dict(
type='mycroft.events.triggered',
namespace="system",
event_name=message.msg_type,
data=message.data
)
LOG.info(f"GUI PROTOCOL - Sending event '{message.msg_type}' for namespace: system")
send_message_to_gui(gui_message)

def handle_clear_namespace(self, message: Message):
"""
Expand Down
6 changes: 3 additions & 3 deletions ovos_gui/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_BUILD = 1
VERSION_ALPHA = 0
VERSION_MINOR = 1
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK
2 changes: 1 addition & 1 deletion test/unittests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch, Mock

import ovos_gui.extensions
from ovos_utils.messagebus import FakeBus
from ovos_utils.fakebus import FakeBus
from ovos_gui.homescreen import HomescreenManager
from ovos_gui.extensions import ExtensionsManager
from .mocks import base_config
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_homescreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch

from ovos_bus_client.message import Message
from ovos_utils.messagebus import FakeBus
from ovos_utils.fakebus import FakeBus
from ovos_gui.namespace import NamespaceManager


Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from unittest.mock import Mock

from ovos_bus_client.message import Message
from ovos_utils.messagebus import FakeBus
from ovos_utils.fakebus import FakeBus

from ovos_gui.constants import GUI_CACHE_PATH
from ovos_gui.namespace import Namespace
Expand Down

0 comments on commit e49d422

Please sign in to comment.