mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-03-02 18:48:04 +01:00
Bump python-mycroft and its dependencies
This commit is contained in:
parent
df21d07af2
commit
b9b7b9361c
@ -1,24 +0,0 @@
|
||||
From d0e630337d7b81abfe7fdf018252e8c6b06f741d Mon Sep 17 00:00:00 2001
|
||||
From: j1nx <p.steenbergen@j1nx.nl>
|
||||
Date: Wed, 17 Feb 2021 13:53:37 +0100
|
||||
Subject: [PATCH 1/1] Bump requests requirement to >= 2.24.0 inline with
|
||||
buildroot. This to prevent issues with the urllib3 package in combination
|
||||
with the HASS skill.
|
||||
|
||||
---
|
||||
requirements/requirements.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
|
||||
index 8c22b4a4c5..dab7856965 100644
|
||||
--- a/requirements/requirements.txt
|
||||
+++ b/requirements/requirements.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-requests==2.20.0
|
||||
+requests>=2.24.0
|
||||
gTTS>=2.2.2,<2.3.0
|
||||
PyAudio==0.2.11
|
||||
pyee==8.1.0
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,292 +0,0 @@
|
||||
From b81587defdd84e1f5d72f9db57eee5c880a77a21 Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Thu, 18 Feb 2021 13:24:34 +0000
|
||||
Subject: [PATCH 1/2] fix/padatious_mess
|
||||
|
||||
---
|
||||
.../intent_services/padatious_service.py | 25 +++
|
||||
mycroft/skills/padatious_service.py | 199 +-----------------
|
||||
2 files changed, 27 insertions(+), 197 deletions(-)
|
||||
|
||||
diff --git a/mycroft/skills/intent_services/padatious_service.py b/mycroft/skills/intent_services/padatious_service.py
|
||||
index f58f86bc195..e1843f6c984 100644
|
||||
--- a/mycroft/skills/intent_services/padatious_service.py
|
||||
+++ b/mycroft/skills/intent_services/padatious_service.py
|
||||
@@ -52,6 +52,11 @@ def __init__(self, bus, config):
|
||||
self.bus.on('detach_intent', self.handle_detach_intent)
|
||||
self.bus.on('detach_skill', self.handle_detach_skill)
|
||||
self.bus.on('mycroft.skills.initialized', self.train)
|
||||
+ self.bus.on('intent.service.padatious.get', self.handle_get_padatious)
|
||||
+ self.bus.on('intent.service.padatious.manifest.get',
|
||||
+ self.handle_manifest)
|
||||
+ self.bus.on('intent.service.padatious.entities.manifest.get',
|
||||
+ self.handle_entity_manifest)
|
||||
|
||||
self.finished_training_event = Event()
|
||||
self.finished_initial_train = False
|
||||
@@ -238,3 +243,23 @@ def calc_intent(self, utt):
|
||||
utt (str): utterance to calculate best intent for
|
||||
"""
|
||||
return self.container.calc_intent(utt)
|
||||
+
|
||||
+ def handle_get_padatious(self, message):
|
||||
+ utterance = message.data["utterance"]
|
||||
+ norm = message.data.get('norm_utt', utterance)
|
||||
+ intent = self.calc_intent(utterance)
|
||||
+ if not intent and norm != utterance:
|
||||
+ intent = self.calc_intent(norm)
|
||||
+ if intent:
|
||||
+ intent = intent.__dict__
|
||||
+ self.bus.emit(message.reply("intent.service.padatious.reply",
|
||||
+ {"intent": intent}))
|
||||
+
|
||||
+ def handle_manifest(self, message):
|
||||
+ self.bus.emit(message.reply("intent.service.padatious.manifest",
|
||||
+ {"intents": self.registered_intents}))
|
||||
+
|
||||
+ def handle_entity_manifest(self, message):
|
||||
+ self.bus.emit(
|
||||
+ message.reply("intent.service.padatious.entities.manifest",
|
||||
+ {"entities": self.registered_entities}))
|
||||
\ No newline at end of file
|
||||
diff --git a/mycroft/skills/padatious_service.py b/mycroft/skills/padatious_service.py
|
||||
index 1b6c248ab04..72f6425d6d7 100644
|
||||
--- a/mycroft/skills/padatious_service.py
|
||||
+++ b/mycroft/skills/padatious_service.py
|
||||
@@ -12,201 +12,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
-from functools import lru_cache
|
||||
-from subprocess import call
|
||||
-from threading import Event
|
||||
-from time import time as get_time, sleep
|
||||
|
||||
-from os.path import expanduser, isfile
|
||||
-
|
||||
-from mycroft.configuration import Configuration
|
||||
-from mycroft.messagebus.message import Message
|
||||
-from mycroft.skills.core import FallbackSkill
|
||||
-from mycroft.util.log import LOG
|
||||
-
|
||||
-
|
||||
-class PadatiousService(FallbackSkill):
|
||||
- instance = None
|
||||
-
|
||||
- fallback_tight_match = 5 # Fallback priority for the conf > 0.8 match
|
||||
- fallback_loose_match = 89 # Fallback priority for the conf > 0.5 match
|
||||
-
|
||||
- def __init__(self, bus, service):
|
||||
- FallbackSkill.__init__(self, use_settings=False)
|
||||
- if not PadatiousService.instance:
|
||||
- PadatiousService.instance = self
|
||||
-
|
||||
- self.padatious_config = Configuration.get()['padatious']
|
||||
- self.service = service
|
||||
- intent_cache = expanduser(self.padatious_config['intent_cache'])
|
||||
-
|
||||
- try:
|
||||
- from padatious import IntentContainer
|
||||
- except ImportError:
|
||||
- LOG.error('Padatious not installed. Please re-run dev_setup.sh')
|
||||
- try:
|
||||
- call(['notify-send', 'Padatious not installed',
|
||||
- 'Please run build_host_setup and dev_setup again'])
|
||||
- except OSError:
|
||||
- pass
|
||||
- return
|
||||
-
|
||||
- self.container = IntentContainer(intent_cache)
|
||||
-
|
||||
- self._bus = bus
|
||||
- self.bus.on('padatious:register_intent', self.register_intent)
|
||||
- self.bus.on('padatious:register_entity', self.register_entity)
|
||||
- self.bus.on('detach_intent', self.handle_detach_intent)
|
||||
- self.bus.on('detach_skill', self.handle_detach_skill)
|
||||
- self.bus.on('mycroft.skills.initialized', self.train)
|
||||
- self.bus.on('intent.service.padatious.get', self.handle_get_padatious)
|
||||
- self.bus.on('intent.service.padatious.manifest.get',
|
||||
- self.handle_manifest)
|
||||
- self.bus.on('intent.service.padatious.entities.manifest.get',
|
||||
- self.handle_entity_manifest)
|
||||
-
|
||||
- # Call Padatious an an early fallback, looking for a high match intent
|
||||
- self.register_fallback(self.handle_fallback,
|
||||
- PadatiousService.fallback_tight_match)
|
||||
-
|
||||
- # Try loose Padatious intent match before going to fallback-unknown
|
||||
- self.register_fallback(self.handle_fallback_last_chance,
|
||||
- PadatiousService.fallback_loose_match)
|
||||
-
|
||||
- self.finished_training_event = Event()
|
||||
- self.finished_initial_train = False
|
||||
-
|
||||
- self.train_delay = self.padatious_config['train_delay']
|
||||
- self.train_time = get_time() + self.train_delay
|
||||
-
|
||||
- self.registered_intents = []
|
||||
- self.registered_entities = []
|
||||
-
|
||||
- def make_active(self):
|
||||
- """Override the make active since this is not a real fallback skill."""
|
||||
- pass
|
||||
-
|
||||
- def train(self, message=None):
|
||||
- padatious_single_thread = Configuration.get()[
|
||||
- 'padatious']['single_thread']
|
||||
- if message is None:
|
||||
- single_thread = padatious_single_thread
|
||||
- else:
|
||||
- single_thread = message.data.get('single_thread',
|
||||
- padatious_single_thread)
|
||||
-
|
||||
- self.finished_training_event.clear()
|
||||
-
|
||||
- LOG.info('Training... (single_thread={})'.format(single_thread))
|
||||
- self.container.train(single_thread=single_thread)
|
||||
- LOG.info('Training complete.')
|
||||
-
|
||||
- self.finished_training_event.set()
|
||||
- if not self.finished_initial_train:
|
||||
- self.bus.emit(Message('mycroft.skills.trained'))
|
||||
- self.finished_initial_train = True
|
||||
-
|
||||
- def wait_and_train(self):
|
||||
- if not self.finished_initial_train:
|
||||
- return
|
||||
- sleep(self.train_delay)
|
||||
- if self.train_time < 0.0:
|
||||
- return
|
||||
-
|
||||
- if self.train_time <= get_time() + 0.01:
|
||||
- self.train_time = -1.0
|
||||
- self.train()
|
||||
-
|
||||
- def __detach_intent(self, intent_name):
|
||||
- """ Remove an intent if it has been registered.
|
||||
-
|
||||
- Arguments:
|
||||
- intent_name (str): intent identifier
|
||||
- """
|
||||
- if intent_name in self.registered_intents:
|
||||
- self.registered_intents.remove(intent_name)
|
||||
- self.container.remove_intent(intent_name)
|
||||
-
|
||||
- def handle_detach_intent(self, message):
|
||||
- self.__detach_intent(message.data.get('intent_name'))
|
||||
-
|
||||
- def handle_detach_skill(self, message):
|
||||
- skill_id = message.data['skill_id']
|
||||
- remove_list = [i for i in self.registered_intents if skill_id in i]
|
||||
- for i in remove_list:
|
||||
- self.__detach_intent(i)
|
||||
-
|
||||
- def _register_object(self, message, object_name, register_func):
|
||||
- file_name = message.data['file_name']
|
||||
- name = message.data['name']
|
||||
-
|
||||
- LOG.debug('Registering Padatious ' + object_name + ': ' + name)
|
||||
-
|
||||
- if not isfile(file_name):
|
||||
- LOG.warning('Could not find file ' + file_name)
|
||||
- return
|
||||
-
|
||||
- register_func(name, file_name)
|
||||
- self.train_time = get_time() + self.train_delay
|
||||
- self.wait_and_train()
|
||||
-
|
||||
- def register_intent(self, message):
|
||||
- self.registered_intents.append(message.data['name'])
|
||||
- self._register_object(message, 'intent', self.container.load_intent)
|
||||
-
|
||||
- def register_entity(self, message):
|
||||
- self.registered_entities.append(message.data)
|
||||
- self._register_object(message, 'entity', self.container.load_entity)
|
||||
-
|
||||
- def handle_fallback(self, message, threshold=0.8):
|
||||
- if not self.finished_training_event.is_set():
|
||||
- LOG.debug('Waiting for Padatious training to finish...')
|
||||
- return False
|
||||
-
|
||||
- utt = message.data.get('utterance', '')
|
||||
- LOG.debug("Padatious fallback attempt: " + utt)
|
||||
- intent = self.calc_intent(utt)
|
||||
-
|
||||
- if not intent or intent.conf < threshold:
|
||||
- # Attempt to use normalized() version
|
||||
- norm = message.data.get('norm_utt', utt)
|
||||
- if norm != utt:
|
||||
- LOG.debug(" alt attempt: " + norm)
|
||||
- intent = self.calc_intent(norm)
|
||||
- utt = norm
|
||||
- if not intent or intent.conf < threshold:
|
||||
- return False
|
||||
-
|
||||
- intent.matches['utterance'] = utt
|
||||
- self.service.add_active_skill(intent.name.split(':')[0])
|
||||
- self.bus.emit(message.forward(intent.name, data=intent.matches))
|
||||
- return True
|
||||
-
|
||||
- def handle_fallback_last_chance(self, message):
|
||||
- return self.handle_fallback(message, 0.5)
|
||||
-
|
||||
- def handle_get_padatious(self, message):
|
||||
- utterance = message.data["utterance"]
|
||||
- norm = message.data.get('norm_utt', utterance)
|
||||
- intent = self.calc_intent(utterance)
|
||||
- if not intent and norm != utterance:
|
||||
- intent = PadatiousService.instance.calc_intent(norm)
|
||||
- if intent:
|
||||
- intent = intent.__dict__
|
||||
- self.bus.emit(message.reply("intent.service.padatious.reply",
|
||||
- {"intent": intent}))
|
||||
-
|
||||
- def handle_manifest(self, message):
|
||||
- self.bus.emit(message.reply("intent.service.padatious.manifest",
|
||||
- {"intents": self.registered_intents}))
|
||||
-
|
||||
- def handle_entity_manifest(self, message):
|
||||
- self.bus.emit(
|
||||
- message.reply("intent.service.padatious.entities.manifest",
|
||||
- {"entities": self.registered_entities}))
|
||||
-
|
||||
- # NOTE: This cache will keep a reference to this calss (PadatiousService),
|
||||
- # but we can live with that since it is used as a singleton.
|
||||
- @lru_cache(maxsize=2) # 2 catches both raw and normalized utts in cache
|
||||
- def calc_intent(self, utt):
|
||||
- return self.container.calc_intent(utt)
|
||||
+## BACKWARDS COMPATIBILITY
|
||||
+from mycroft.skills.intent_services.padatious_service import PadatiousService
|
||||
|
||||
From bd5bd6fac9258a733b099f66679b8b762ae87a77 Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Thu, 18 Feb 2021 13:32:08 +0000
|
||||
Subject: [PATCH 2/2] pep8
|
||||
|
||||
---
|
||||
mycroft/skills/intent_services/padatious_service.py | 2 +-
|
||||
mycroft/skills/padatious_service.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mycroft/skills/intent_services/padatious_service.py b/mycroft/skills/intent_services/padatious_service.py
|
||||
index e1843f6c984..d3fcc18de47 100644
|
||||
--- a/mycroft/skills/intent_services/padatious_service.py
|
||||
+++ b/mycroft/skills/intent_services/padatious_service.py
|
||||
@@ -262,4 +262,4 @@ def handle_manifest(self, message):
|
||||
def handle_entity_manifest(self, message):
|
||||
self.bus.emit(
|
||||
message.reply("intent.service.padatious.entities.manifest",
|
||||
- {"entities": self.registered_entities}))
|
||||
\ No newline at end of file
|
||||
+ {"entities": self.registered_entities}))
|
||||
diff --git a/mycroft/skills/padatious_service.py b/mycroft/skills/padatious_service.py
|
||||
index 72f6425d6d7..6dffa13d872 100644
|
||||
--- a/mycroft/skills/padatious_service.py
|
||||
+++ b/mycroft/skills/padatious_service.py
|
||||
@@ -13,5 +13,5 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
-## BACKWARDS COMPATIBILITY
|
||||
+# BACKWARDS COMPATIBILITY
|
||||
from mycroft.skills.intent_services.padatious_service import PadatiousService
|
@ -1,375 +0,0 @@
|
||||
From ae33770b5b842b9ac51fa7eefcb9b3808590f2e8 Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Thu, 18 Feb 2021 18:28:31 +0000
|
||||
Subject: [PATCH 1/4] enclosure cleanup
|
||||
|
||||
---
|
||||
mycroft/client/enclosure/base.py | 39 ++++++
|
||||
mycroft/client/enclosure/generic/__init__.py | 139 +------------------
|
||||
2 files changed, 42 insertions(+), 136 deletions(-)
|
||||
|
||||
diff --git a/mycroft/client/enclosure/base.py b/mycroft/client/enclosure/base.py
|
||||
index 4d26a42f43f..7d55040d13b 100644
|
||||
--- a/mycroft/client/enclosure/base.py
|
||||
+++ b/mycroft/client/enclosure/base.py
|
||||
@@ -23,6 +23,7 @@
|
||||
from mycroft.util.log import LOG
|
||||
|
||||
import json
|
||||
+import time
|
||||
import tornado.web as web
|
||||
from tornado import ioloop
|
||||
from tornado.websocket import WebSocketHandler
|
||||
@@ -70,6 +71,10 @@ def __init__(self):
|
||||
# Create Message Bus Client
|
||||
self.bus = MessageBusClient()
|
||||
|
||||
+ # TODO: this requires the Enclosure to be up and running before the
|
||||
+ # training is complete.
|
||||
+ self.bus.on('mycroft.skills.trained', self.is_device_ready)
|
||||
+
|
||||
self.gui = create_gui_service(self, config['gui_websocket'])
|
||||
# This datastore holds the data associated with the GUI provider. Data
|
||||
# is stored in Namespaces, so you can have:
|
||||
@@ -115,6 +120,40 @@ def stop(self):
|
||||
"""Perform any enclosure shutdown processes."""
|
||||
pass
|
||||
|
||||
+ def is_device_ready(self, message):
|
||||
+ is_ready = False
|
||||
+ # Bus service assumed to be alive if messages sent and received
|
||||
+ # Enclosure assumed to be alive if this method is running
|
||||
+ services = {'audio': False, 'speech': False, 'skills': False}
|
||||
+ start = time.monotonic()
|
||||
+ while not is_ready:
|
||||
+ is_ready = self.check_services_ready(services)
|
||||
+ if is_ready:
|
||||
+ break
|
||||
+ elif time.monotonic() - start >= 60:
|
||||
+ raise Exception('Timeout waiting for services start.')
|
||||
+ else:
|
||||
+ time.sleep(3)
|
||||
+
|
||||
+ if is_ready:
|
||||
+ LOG.info("Mycroft is all loaded and ready to roll!")
|
||||
+ self.bus.emit(Message('mycroft.ready'))
|
||||
+
|
||||
+ return is_ready
|
||||
+
|
||||
+ def check_services_ready(self, services):
|
||||
+ """Report if all specified services are ready.
|
||||
+
|
||||
+ services (iterable): service names to check.
|
||||
+ """
|
||||
+ for ser in services:
|
||||
+ services[ser] = False
|
||||
+ response = self.bus.wait_for_response(Message(
|
||||
+ 'mycroft.{}.is_ready'.format(ser)))
|
||||
+ if response and response.data['status']:
|
||||
+ services[ser] = True
|
||||
+ return all([services[ser] for ser in services])
|
||||
+
|
||||
######################################################################
|
||||
# GUI client API
|
||||
@property
|
||||
diff --git a/mycroft/client/enclosure/generic/__init__.py b/mycroft/client/enclosure/generic/__init__.py
|
||||
index 3c47a545943..23c4fde794c 100644
|
||||
--- a/mycroft/client/enclosure/generic/__init__.py
|
||||
+++ b/mycroft/client/enclosure/generic/__init__.py
|
||||
@@ -12,144 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
-import subprocess
|
||||
-import time
|
||||
-import sys
|
||||
-from threading import Thread, Timer
|
||||
-
|
||||
-import mycroft.dialog
|
||||
from mycroft.client.enclosure.base import Enclosure
|
||||
-from mycroft.api import has_been_paired
|
||||
-from mycroft.audio import wait_while_speaking
|
||||
-from mycroft.enclosure.display_manager import \
|
||||
- init_display_manager_bus_connection
|
||||
-from mycroft.messagebus.message import Message
|
||||
-from mycroft.util import connected
|
||||
-from mycroft.util.log import LOG
|
||||
|
||||
|
||||
class EnclosureGeneric(Enclosure):
|
||||
"""
|
||||
- Serves as a communication interface between a simple text frontend and
|
||||
- Mycroft Core. This is used for Picroft or other headless systems,
|
||||
- and/or for users of the CLI.
|
||||
- """
|
||||
-
|
||||
- _last_internet_notification = 0
|
||||
-
|
||||
- def __init__(self):
|
||||
- super().__init__()
|
||||
-
|
||||
- # Notifications from mycroft-core
|
||||
- self.bus.on('enclosure.notify.no_internet', self.on_no_internet)
|
||||
- # TODO: this requires the Enclosure to be up and running before the
|
||||
- # training is complete.
|
||||
- self.bus.on('mycroft.skills.trained', self.is_device_ready)
|
||||
-
|
||||
- # initiates the web sockets on display manager
|
||||
- # NOTE: this is a temporary place to connect the display manager
|
||||
- init_display_manager_bus_connection()
|
||||
-
|
||||
- # verify internet connection and prompt user on bootup if needed
|
||||
- if not connected():
|
||||
- # We delay this for several seconds to ensure that the other
|
||||
- # clients are up and connected to the messagebus in order to
|
||||
- # receive the "speak". This was sometimes happening too
|
||||
- # quickly and the user wasn't notified what to do.
|
||||
- Timer(5, self._do_net_check).start()
|
||||
-
|
||||
- def is_device_ready(self, message):
|
||||
- is_ready = False
|
||||
- # Bus service assumed to be alive if messages sent and received
|
||||
- # Enclosure assumed to be alive if this method is running
|
||||
- services = {'audio': False, 'speech': False, 'skills': False}
|
||||
- start = time.monotonic()
|
||||
- while not is_ready:
|
||||
- is_ready = self.check_services_ready(services)
|
||||
- if is_ready:
|
||||
- break
|
||||
- elif time.monotonic() - start >= 60:
|
||||
- raise Exception('Timeout waiting for services start.')
|
||||
- else:
|
||||
- time.sleep(3)
|
||||
-
|
||||
- if is_ready:
|
||||
- LOG.info("Mycroft is all loaded and ready to roll!")
|
||||
- self.bus.emit(Message('mycroft.ready'))
|
||||
-
|
||||
- return is_ready
|
||||
-
|
||||
- def check_services_ready(self, services):
|
||||
- """Report if all specified services are ready.
|
||||
-
|
||||
- services (iterable): service names to check.
|
||||
- """
|
||||
- for ser in services:
|
||||
- services[ser] = False
|
||||
- response = self.bus.wait_for_response(Message(
|
||||
- 'mycroft.{}.is_ready'.format(ser)))
|
||||
- if response and response.data['status']:
|
||||
- services[ser] = True
|
||||
- return all([services[ser] for ser in services])
|
||||
-
|
||||
- def on_no_internet(self, event=None):
|
||||
- if connected():
|
||||
- # One last check to see if connection was established
|
||||
- return
|
||||
-
|
||||
- if time.time() - Enclosure._last_internet_notification < 30:
|
||||
- # don't bother the user with multiple notifications with 30 secs
|
||||
- return
|
||||
-
|
||||
- Enclosure._last_internet_notification = time.time()
|
||||
-
|
||||
- # TODO: This should go into EnclosureMark1 subclass of Enclosure.
|
||||
- if has_been_paired():
|
||||
- # Handle the translation within that code.
|
||||
- self.bus.emit(Message("speak", {
|
||||
- 'utterance': "This device is not connected to the Internet. "
|
||||
- "Either plug in a network cable or set up your "
|
||||
- "wifi connection."}))
|
||||
- else:
|
||||
- # enter wifi-setup mode automatically
|
||||
- self.bus.emit(Message('system.wifi.setup', {'lang': self.lang}))
|
||||
-
|
||||
- def speak(self, text):
|
||||
- self.bus.emit(Message("speak", {'utterance': text}))
|
||||
-
|
||||
- def _handle_pairing_complete(self, _):
|
||||
- """
|
||||
- Handler for 'mycroft.paired', unmutes the mic after the pairing is
|
||||
- complete.
|
||||
- """
|
||||
- self.bus.emit(Message("mycroft.mic.unmute"))
|
||||
-
|
||||
- def _do_net_check(self):
|
||||
- # TODO: This should live in the derived Enclosure, e.g. EnclosureMark1
|
||||
- LOG.info("Checking internet connection")
|
||||
- if not connected(): # and self.conn_monitor is None:
|
||||
- if has_been_paired():
|
||||
- # TODO: Enclosure/localization
|
||||
- self.speak("This unit is not connected to the Internet. "
|
||||
- "Either plug in a network cable or setup your "
|
||||
- "wifi connection.")
|
||||
- else:
|
||||
- # Begin the unit startup process, this is the first time it
|
||||
- # is being run with factory defaults.
|
||||
-
|
||||
- # TODO: This logic should be in EnclosureMark1
|
||||
- # TODO: Enclosure/localization
|
||||
-
|
||||
- # Don't listen to mic during this out-of-box experience
|
||||
- self.bus.emit(Message("mycroft.mic.mute"))
|
||||
- # Setup handler to unmute mic at the end of on boarding
|
||||
- # i.e. after pairing is complete
|
||||
- self.bus.once('mycroft.paired', self._handle_pairing_complete)
|
||||
-
|
||||
- self.speak(mycroft.dialog.get('mycroft.intro'))
|
||||
- wait_while_speaking()
|
||||
- time.sleep(2) # a pause sounds better than just jumping in
|
||||
-
|
||||
- # Kick off wifi-setup automatically
|
||||
- data = {'allow_timeout': False, 'lang': self.lang}
|
||||
- self.bus.emit(Message('system.wifi.setup', data))
|
||||
+ Serves as a communication interface between GUI and
|
||||
+ Mycroft Core. This is used for Picroft or other headless systems
|
||||
+ """
|
||||
\ No newline at end of file
|
||||
|
||||
From a5ab14ae5acc5c88fef2dbb23a6729d1eff5ca9e Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Thu, 18 Feb 2021 19:24:59 +0000
|
||||
Subject: [PATCH 2/4] only report ready after pairing
|
||||
|
||||
---
|
||||
mycroft/client/enclosure/base.py | 22 +++++++++++++++-------
|
||||
1 file changed, 15 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/mycroft/client/enclosure/base.py b/mycroft/client/enclosure/base.py
|
||||
index 7d55040d13b..aacefe46449 100644
|
||||
--- a/mycroft/client/enclosure/base.py
|
||||
+++ b/mycroft/client/enclosure/base.py
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
from collections import namedtuple
|
||||
from threading import Lock
|
||||
-
|
||||
+from mycroft.api import is_paired
|
||||
from mycroft.configuration import Configuration
|
||||
from mycroft.messagebus.client import MessageBusClient
|
||||
from mycroft.util import create_daemon, start_message_bus_client
|
||||
@@ -73,7 +73,8 @@ def __init__(self):
|
||||
|
||||
# TODO: this requires the Enclosure to be up and running before the
|
||||
# training is complete.
|
||||
- self.bus.on('mycroft.skills.trained', self.is_device_ready)
|
||||
+ self.bus.once('mycroft.skills.trained',
|
||||
+ self.handle_check_device_readiness)
|
||||
|
||||
self.gui = create_gui_service(self, config['gui_websocket'])
|
||||
# This datastore holds the data associated with the GUI provider. Data
|
||||
@@ -120,7 +121,7 @@ def stop(self):
|
||||
"""Perform any enclosure shutdown processes."""
|
||||
pass
|
||||
|
||||
- def is_device_ready(self, message):
|
||||
+ def is_device_ready(self):
|
||||
is_ready = False
|
||||
# Bus service assumed to be alive if messages sent and received
|
||||
# Enclosure assumed to be alive if this method is running
|
||||
@@ -134,12 +135,19 @@ def is_device_ready(self, message):
|
||||
raise Exception('Timeout waiting for services start.')
|
||||
else:
|
||||
time.sleep(3)
|
||||
+ return is_ready
|
||||
|
||||
- if is_ready:
|
||||
- LOG.info("Mycroft is all loaded and ready to roll!")
|
||||
- self.bus.emit(Message('mycroft.ready'))
|
||||
+ def handle_check_device_readiness(self, message):
|
||||
|
||||
- return is_ready
|
||||
+ def handle_ready(message=None):
|
||||
+ if self.is_device_ready():
|
||||
+ LOG.info("Mycroft is all loaded and ready to roll!")
|
||||
+ self.bus.emit(Message('mycroft.ready'))
|
||||
+
|
||||
+ if not is_paired():
|
||||
+ self.bus.once("mycroft.paired", handle_ready)
|
||||
+ else:
|
||||
+ handle_ready()
|
||||
|
||||
def check_services_ready(self, services):
|
||||
"""Report if all specified services are ready.
|
||||
|
||||
From 4d67450e0e1b9d86a1d452f7e683500335224d3b Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Sun, 21 Feb 2021 15:01:30 +0000
|
||||
Subject: [PATCH 3/4] pairing non sense
|
||||
|
||||
---
|
||||
mycroft/skills/__main__.py | 12 ++++--------
|
||||
mycroft/stt/__init__.py | 2 +-
|
||||
2 files changed, 5 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/mycroft/skills/__main__.py b/mycroft/skills/__main__.py
|
||||
index 0d0cc378edf..bca66ccdfc1 100644
|
||||
--- a/mycroft/skills/__main__.py
|
||||
+++ b/mycroft/skills/__main__.py
|
||||
@@ -39,10 +39,10 @@
|
||||
from mycroft.util.lang import set_active_lang
|
||||
from mycroft.util.log import LOG
|
||||
from mycroft.util.process_utils import ProcessStatus, StatusCallbackMap
|
||||
-from .core import FallbackSkill
|
||||
-from .event_scheduler import EventScheduler
|
||||
-from .intent_service import IntentService
|
||||
-from .skill_manager import SkillManager
|
||||
+from mycroft.skills.core import FallbackSkill
|
||||
+from mycroft.skills.event_scheduler import EventScheduler
|
||||
+from mycroft.skills.intent_service import IntentService
|
||||
+from mycroft.skills.skill_manager import SkillManager
|
||||
|
||||
RASPBERRY_PI_PLATFORMS = ('mycroft_mark_1', 'picroft', 'mycroft_mark_2pi')
|
||||
|
||||
@@ -127,10 +127,6 @@ def _ensure_device_is_paired(self):
|
||||
Pairing cannot be performed if there is no connection to the back end.
|
||||
So skip pairing if the backend is down.
|
||||
"""
|
||||
- if not self.is_paired and not self.backend_down:
|
||||
- LOG.info('Device not paired, invoking the pairing skill')
|
||||
- payload = dict(utterances=["pair my device"], lang="en-us")
|
||||
- self.bus.emit(Message("recognizer_loop:utterance", payload))
|
||||
|
||||
def _update_device_attributes_on_backend(self):
|
||||
"""Communicate version information to the backend.
|
||||
diff --git a/mycroft/stt/__init__.py b/mycroft/stt/__init__.py
|
||||
index 5028f20ea1d..a0d49a6e510 100644
|
||||
--- a/mycroft/stt/__init__.py
|
||||
+++ b/mycroft/stt/__init__.py
|
||||
@@ -285,7 +285,7 @@ def wrapper(*args, **kwargs):
|
||||
if e.response.status_code == 401:
|
||||
LOG.warning('Access Denied at mycroft.ai')
|
||||
# phrase to start the pairing process
|
||||
- return 'pair my device'
|
||||
+ return None
|
||||
else:
|
||||
raise
|
||||
return wrapper
|
||||
|
||||
From 87113e92f3909a13c1007d6f935398aa98d96be3 Mon Sep 17 00:00:00 2001
|
||||
From: jarbasal <jarbasai@mailfence.com>
|
||||
Date: Sun, 21 Feb 2021 20:45:50 +0000
|
||||
Subject: [PATCH 4/4] pairing trigger
|
||||
|
||||
---
|
||||
mycroft/skills/__main__.py | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/mycroft/skills/__main__.py b/mycroft/skills/__main__.py
|
||||
index bca66ccdfc1..609fb0ee932 100644
|
||||
--- a/mycroft/skills/__main__.py
|
||||
+++ b/mycroft/skills/__main__.py
|
||||
@@ -123,10 +123,10 @@ def _display_skill_loading_notification(self):
|
||||
|
||||
def _ensure_device_is_paired(self):
|
||||
"""Determine if device is paired, if not automatically start pairing.
|
||||
-
|
||||
- Pairing cannot be performed if there is no connection to the back end.
|
||||
- So skip pairing if the backend is down.
|
||||
"""
|
||||
+ if not self.is_paired:
|
||||
+ LOG.info('Device not paired, invoking the pairing skill')
|
||||
+ self.bus.emit(Message("mycroft.not.paired"))
|
||||
|
||||
def _update_device_attributes_on_backend(self):
|
||||
"""Communicate version information to the backend.
|
@ -1 +1 @@
|
||||
sha256 48e54c3e05347667e068cf6db5cd0905647b85bea32533d8e4aedf0611776185 python-mycroft-a976bd1094dbfba155811df1ca227b40be9422ff.tar.gz
|
||||
sha256 fc0b7c2411829fb88259c4f45f9b5ae8875e27f87e651398430bd40d7ca8fe37 python-mycroft-fd4e0dc160391f1b5703c66f9482e93d30c15118.tar.gz
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_MYCROFT_VERSION = a976bd1094dbfba155811df1ca227b40be9422ff
|
||||
PYTHON_MYCROFT_VERSION = fd4e0dc160391f1b5703c66f9482e93d30c15118
|
||||
PYTHON_MYCROFT_SITE = $(call github,MycroftAI,mycroft-core,$(PYTHON_MYCROFT_VERSION))
|
||||
PYTHON_MYCROFT_SETUP_TYPE = setuptools
|
||||
PYTHON_MYCROFT_LICENSE_FILES = LICENSE
|
||||
|
@ -1,7 +1,7 @@
|
||||
From e33b75b1d7184d593b376b70cb6253edbd96215f Mon Sep 17 00:00:00 2001
|
||||
From ef42b24ee3a4c4ddf58a56a4e35d07cc8942d45f Mon Sep 17 00:00:00 2001
|
||||
From: j1nx <p.steenbergen@j1nx.nl>
|
||||
Date: Thu, 18 Mar 2021 15:18:06 +0100
|
||||
Subject: [PATCH 1/1] Downgrade python-pyyaml to 5.1.2
|
||||
Date: Mon, 29 Mar 2021 10:54:29 +0200
|
||||
Subject: [PATCH 1/1] Downgrade python-pyyaml to 5.4
|
||||
|
||||
---
|
||||
package/python-pyyaml/python-pyyaml.hash | 2 +-
|
||||
@ -10,18 +10,18 @@ Subject: [PATCH 1/1] Downgrade python-pyyaml to 5.1.2
|
||||
3 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/package/python-pyyaml/python-pyyaml.hash b/package/python-pyyaml/python-pyyaml.hash
|
||||
index 82b2f4f880..025b5ac065 100644
|
||||
index 82b2f4f880..93d1af5879 100644
|
||||
--- a/package/python-pyyaml/python-pyyaml.hash
|
||||
+++ b/package/python-pyyaml/python-pyyaml.hash
|
||||
@@ -1,5 +1,5 @@
|
||||
# md5, sha256 from https://pypi.org/pypi/PyYAML/json
|
||||
md5 46e25294c7efec23d4072ed6a7777f46 PyYAML-5.4.1.tar.gz
|
||||
-sha256 607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e PyYAML-5.4.1.tar.gz
|
||||
+sha256 01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4 PyYAML-5.1.2.tar.gz
|
||||
+sha256 3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a PyYAML-5.4.tar.gz
|
||||
# Locally computed sha256 checksums
|
||||
sha256 8d3928f9dc4490fd635707cb88eb26bd764102a7282954307d3e5167a577e8a4 LICENSE
|
||||
diff --git a/package/python-pyyaml/python-pyyaml.mk b/package/python-pyyaml/python-pyyaml.mk
|
||||
index c9013de8ec..87c2079f92 100644
|
||||
index c9013de8ec..fb3f42251b 100644
|
||||
--- a/package/python-pyyaml/python-pyyaml.mk
|
||||
+++ b/package/python-pyyaml/python-pyyaml.mk
|
||||
@@ -5,9 +5,9 @@
|
||||
@ -29,16 +29,15 @@ index c9013de8ec..87c2079f92 100644
|
||||
|
||||
# Please keep in sync package/python3-pyyaml/python3-pyyaml.mk
|
||||
-PYTHON_PYYAML_VERSION = 5.4.1
|
||||
+PYTHON_PYYAML_VERSION = 5.1.2
|
||||
+PYTHON_PYYAML_VERSION = 5.4
|
||||
PYTHON_PYYAML_SOURCE = PyYAML-$(PYTHON_PYYAML_VERSION).tar.gz
|
||||
-PYTHON_PYYAML_SITE = https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d
|
||||
+PYTHON_PYYAML_SITE = https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe
|
||||
-PYTHON_PYYAML_SETUP_TYPE = setuptools
|
||||
+PYTHON_PYYAML_SETUP_TYPE = distutils
|
||||
+PYTHON_PYYAML_SITE = https://files.pythonhosted.org/packages/b5/fd/15638de2da0a5aa91c095718444624aa565f766fc178249ca6faa372f71a
|
||||
PYTHON_PYYAML_SETUP_TYPE = setuptools
|
||||
PYTHON_PYYAML_LICENSE = MIT
|
||||
PYTHON_PYYAML_LICENSE_FILES = LICENSE
|
||||
diff --git a/package/python3-pyyaml/python3-pyyaml.mk b/package/python3-pyyaml/python3-pyyaml.mk
|
||||
index f758341502..5a331905a3 100644
|
||||
index f758341502..0ed35c5335 100644
|
||||
--- a/package/python3-pyyaml/python3-pyyaml.mk
|
||||
+++ b/package/python3-pyyaml/python3-pyyaml.mk
|
||||
@@ -5,9 +5,9 @@
|
||||
@ -46,12 +45,11 @@ index f758341502..5a331905a3 100644
|
||||
|
||||
# Please keep in sync with package/python-pyyaml/python-pyyaml.mk
|
||||
-PYTHON3_PYYAML_VERSION = 5.4.1
|
||||
+PYTHON3_PYYAML_VERSION = 5.1.2
|
||||
+PYTHON3_PYYAML_VERSION = 5.4
|
||||
PYTHON3_PYYAML_SOURCE = PyYAML-$(PYTHON3_PYYAML_VERSION).tar.gz
|
||||
-PYTHON3_PYYAML_SITE = https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d
|
||||
+PYTHON3_PYYAML_SITE = https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe
|
||||
-PYTHON3_PYYAML_SETUP_TYPE = setuptools
|
||||
+PYTHON3_PYYAML_SETUP_TYPE = distutils
|
||||
+PYTHON3_PYYAML_SITE = https://files.pythonhosted.org/packages/b5/fd/15638de2da0a5aa91c095718444624aa565f766fc178249c
|
||||
PYTHON3_PYYAML_SETUP_TYPE = setuptools
|
||||
PYTHON3_PYYAML_LICENSE = MIT
|
||||
PYTHON3_PYYAML_LICENSE_FILES = LICENSE
|
||||
--
|
Loading…
x
Reference in New Issue
Block a user