Skip to content

Commit

Permalink
Merge pull request #134 from OpenVoiceOS/release-0.1.6a1
Browse files Browse the repository at this point in the history
Release 0.1.6a1
  • Loading branch information
JarbasAl authored Oct 27, 2024
2 parents fd603ca + 395d12b commit 870a475
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [0.1.5a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.1.5a1) (2024-10-21)
## [0.1.6a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.1.6a1) (2024-10-27)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.1.4...0.1.5a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.1.5...0.1.6a1)

**Merged pull requests:**

- fix:log spam [\#131](https://github.com/OpenVoiceOS/ovos-bus-client/pull/131) ([JarbasAl](https://github.com/JarbasAl))
- fix:gui spam [\#133](https://github.com/OpenVoiceOS/ovos-bus-client/pull/133) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
16 changes: 16 additions & 0 deletions ovos_bus_client/apis/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def set_bus(self, bus=None):
self._bus = bus or get_mycroft_bus()
self.setup_default_handlers()

@property
def gui_disabled(self) -> bool:
return Configuration().get("gui", {}).get("disable_gui", False)

@property
def bus(self):
"""
Expand Down Expand Up @@ -276,6 +280,8 @@ def gui_set(self, message: Message):
self.on_gui_changed_callback()

def _sync_data(self):
if self.gui_disabled:
return
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
data = self.__session_data.copy()
Expand Down Expand Up @@ -322,6 +328,8 @@ def clear(self):
self.__session_data = {}
self._pages = []
self.current_page_idx = -1
if self.gui_disabled:
return
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
self.bus.emit(Message("gui.clear.namespace",
Expand All @@ -337,6 +345,8 @@ def send_event(self, event_name: str,
params: json serializable object containing any parameters that
should be sent along with the request.
"""
if self.gui_disabled:
return
params = params or {}
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
Expand Down Expand Up @@ -442,6 +452,8 @@ def show_pages(self, page_names: List[str], index: int = 0,
self._pages = page_names
self.current_page_idx = index

if self.gui_disabled:
return
# First sync any data...
data = self.__session_data.copy()
data.update({'__from': self.skill_id})
Expand Down Expand Up @@ -470,6 +482,8 @@ def remove_pages(self, page_names: List[str]):
Request to remove a list of pages from the GUI.
@param page_names: list of page resources requested
"""
if self.gui_disabled:
return
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
if isinstance(page_names, str):
Expand All @@ -489,6 +503,8 @@ def remove_all_pages(self, except_pages=None):
Request to remove all pages from the GUI.
@param except_pages: list of optional page resources to keep
"""
if self.gui_disabled:
return
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
self.bus.emit(Message("gui.page.delete.all",
Expand Down
4 changes: 2 additions & 2 deletions ovos_bus_client/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 1
VERSION_BUILD = 5
VERSION_ALPHA = 0
VERSION_BUILD = 6
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit 870a475

Please sign in to comment.