Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Remove enclosure stuff #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ def initialize(self):
self.brightness_dict = self.translate_namedvalues("brightness.levels")
self.gui["volume"] = 0

# Prepare GUI Viseme structure
self.gui["viseme"] = {"start": 0, "visemes": []}

store_conf = join(self.file_system.path, 'skill_conf.json')
if not self.file_system.exists("skill_conf.json"):
self.skill_conf = JsonStorage(store_conf)
Expand All @@ -201,17 +198,8 @@ def initialize(self):
self.skill_conf = JsonStorage(store_conf)

try:
# Handle network connection events
self.add_event("mycroft.internet.connected", self.handle_internet_connected)

# Handle the 'busy' visual
self.bus.on("mycroft.skill.handler.start", self.on_handler_started)

self.bus.on("recognizer_loop:sleep", self.on_handler_sleep)
self.bus.on("mycroft.awoken", self.on_handler_awoken)
self.bus.on("enclosure.mouth.reset", self.on_handler_mouth_reset)
self.bus.on("recognizer_loop:audio_output_end", self.on_handler_mouth_reset)
self.bus.on("enclosure.mouth.viseme_list", self.on_handler_speaking)
self.bus.on("gui.page.show", self.on_gui_page_show)
self.bus.on("gui.page_interaction", self.on_gui_page_interaction)

Expand Down Expand Up @@ -263,9 +251,6 @@ def initialize(self):
self.add_event("system.display.homescreen",
self.resting_screen.force_stop)

# Show loading screen while starting up skills.
# self.gui['state'] = 'loading'
# self.gui.show_page('all.qml')

# Collect Idle screens and display if skill is restarted
self.device_paired = is_paired()
Expand Down Expand Up @@ -331,18 +316,12 @@ def stop(self, _=None):
"""Clear override_idle and stop visemes."""
self.log.debug("Stop received")
self.resting_screen.stop()
self.gui["viseme"] = {"start": 0, "visemes": []}
return False

def shutdown(self):
"""Cleanly shutdown the Skill removing any manual event handlers"""
# Gotta clean up manually since not using add_event()
self.bus.remove("mycroft.skill.handler.start", self.on_handler_started)
self.bus.remove("recognizer_loop:sleep", self.on_handler_sleep)
self.bus.remove("mycroft.awoken", self.on_handler_awoken)
self.bus.remove("enclosure.mouth.reset", self.on_handler_mouth_reset)
self.bus.remove("recognizer_loop:audio_output_end", self.on_handler_mouth_reset)
self.bus.remove("enclosure.mouth.viseme_list", self.on_handler_speaking)
self.bus.remove("gui.page.show", self.on_gui_page_show)
self.bus.remove("gui.page_interaction", self.on_gui_page_interaction)
self.bus.remove("mycroft.mark2.register_idle", self.resting_screen.on_register)
Expand Down Expand Up @@ -410,20 +389,6 @@ def on_gui_page_show(self, message):
# Set default idle screen timer
self.start_idle_event(30)

def on_handler_mouth_reset(self, _):
""" Restore viseme to a smile. """
pass

def on_handler_sleep(self, _):
""" Show resting face when going to sleep. """
self.gui["state"] = "resting"
self.gui.show_page("all.qml")

def on_handler_awoken(self, _):
""" Show awake face when sleep ends. """
self.gui["state"] = "awake"
self.gui.show_page("all.qml")

def on_handler_complete(self, message):
""" When a skill finishes executing clear the showing page state. """
handler = message.data.get("handler", "")
Expand All @@ -446,22 +411,6 @@ def on_handler_complete(self, message):
# catches the mycroft.skill.handler.complete
pass

#####################################################################
# Manage "speaking" visual

def on_handler_speaking(self, message):
"""Show the speaking page if no skill has registered a page
to be shown in it's place.
"""
if self.device_paired or self.device_backend == "local":
self.gui["viseme"] = message.data
if not self.has_show_page:
self.gui["state"] = "speaking"
self.gui.show_page("all.qml")
# Show idle screen after the visemes are done (+ 2 sec).
viseme_time = message.data["visemes"][-1][1] + 5
self.start_idle_event(viseme_time)

#####################################################################
# Manage resting screen visual state
def cancel_idle_event(self):
Expand Down Expand Up @@ -495,13 +444,6 @@ def start_idle_event(self, offset=60, weak=False):
except Exception as e:
self.log.exception(repr(e))

#####################################################################
# Manage network

def handle_internet_connected(self, _):
""" System came online later after booting. """
self.enclosure.mouth_reset()

#####################################################################
# Web settings

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
setup(
# this is the package name that goes on pip
name='ovos-skill-mycroft-gui',
version='0.0.1',
version='0.0.2',
description='OVOS mycroft gui skill plugin',
url='https://github.com/OpenVoiceOS/skill-ovos-mycroftgui',
author='AIIX',
Expand Down
133 changes: 0 additions & 133 deletions ui/Face.qml

This file was deleted.

27 changes: 0 additions & 27 deletions ui/VolumeBar.qml

This file was deleted.

11 changes: 0 additions & 11 deletions ui/awake.qml

This file was deleted.

3 changes: 0 additions & 3 deletions ui/face/Eyeball.svg

This file was deleted.

3 changes: 0 additions & 3 deletions ui/face/GreySmile.svg

This file was deleted.

3 changes: 0 additions & 3 deletions ui/face/Smile.svg

This file was deleted.

3 changes: 0 additions & 3 deletions ui/face/lid.svg

This file was deleted.

Loading