Commit Graph

2324 Commits (0faa2a4451d64571f81874bc9cd27a256a436564)

Author SHA1 Message Date
Åke Forslund 0689f60747 remove "is True" check 2019-07-22 09:25:49 +02:00
Åke Forslund db94123d96 Replace oldstyle super class access with new 2019-07-22 09:24:36 +02:00
Åke Forslund 5dc8802146 Look over docstrings.
Update docstrings of the files affected by this reoriganization.
- PEP 257
- Add missing
2019-07-22 09:16:53 +02:00
Åke Forslund b7b5e9bfcb Refactor mycroft.skills.core
- MycroftSkill and related core functions to mycroft_skill.py
- FallbackSkill to fallback_skill.py
- Add important classes decorators and functions to __init__.py
- move SkillGUI class to the enclosure along with the other enclosure
  interfaces

core.py retains the same members as previously by means of imports to
retain backwards compatibility. When most of the available skills starts
using this new structure properly
2019-07-22 06:46:31 +02:00
Åke bb779e6136
Merge pull request #2217 from forslund/bugfix/quick-download
Move quick skill update to after internet check
2019-07-19 13:13:03 +02:00
Chris Veilleux edcc1c261e simplified super() call to use Python 3 syntax 2019-07-19 08:16:55 +02:00
Chris Veilleux 2c67381aee added module level docstring 2019-07-19 08:16:55 +02:00
Chris Veilleux be3dff99a1 added licence info to files without it and a missing docstring 2019-07-19 08:16:55 +02:00
Chris Veilleux 4e9130114e remove validate_param since it's now unused 2019-07-19 08:16:54 +02:00
Chris Veilleux d8f3095d40 Rename the message bus client and abstract config loading
Message bus config loading is now shared by service and client.

messagebus.client.ws file is still available in case skills are using it. It is a backport that inherits from the new MessageBusClient class. Adds depreciation warning.
2019-07-19 08:16:54 +02:00
Chris Veilleux 3efce9639e Clean up of messagbus/send.py
- reorder imports
- refactor docstrings for consistency
- rename camel case variables to use snake case
2019-07-19 08:16:54 +02:00
Chris Veilleux 7a7ed8944d Clean up of message.py 2019-07-19 08:16:54 +02:00
Chris Veilleux 468fb800a7 refactor messagebus service:
- add some docstrings
- put config retrieval in a function
- add log messages
2019-07-19 08:16:09 +02:00
Åke 345e28f5fa
Merge pull request #2206 from MycroftAI/doc/readthedocs2
Quickfix: readthedocs build
2019-07-18 14:55:13 +02:00
Åke Forslund 8b03a93dc1 Move quick skill update to after internet check 2019-07-18 14:25:31 +02:00
Åke Forslund 3e0cac8c1e Trigger settings update on pairing complete 2019-07-14 21:01:44 +02:00
Åke Forslund ddb9d5b0a2 Hack: Fix readthedocs build
The Mycroft API documentation were blank due to the import of the yaml
module for some reason. This moves the import into the method where it's
used
2019-07-14 08:17:05 +02:00
Kris Gesling efa69e0526 'next {day}' to be 3-9 days in future (#2184)
* 'next {day}' to be 2-9 days in future

* restore module level docstring

* remove lang specific definition of 'next'

* restore module level docstring
2019-07-13 11:53:38 +02:00
David Wagner 4b480dcf32
Add mycroft_mark_2pi to platforms needing ntp sync 2019-07-12 06:56:35 -05:00
Åke cddb1ab981
Merge pull request #2190 from strugee/patch-1
Recognize "confirm[ed]" as a word for "yes"
2019-07-12 08:41:04 +02:00
Åke fc0a253c28 Fetch CLI log path from config if available (#2192)
* Fetch CLI log path from config if available

* Remove the old log locations
2019-07-11 17:40:40 -05:00
Åke da00b38f82 Explain the config system used here. (#2201)
- Add module docstring
- Add comment in the init class method about setting up the log level
- Add mycroft.util.log to the readthedocs documentation
- Add comment in the config about the log_level
2019-07-11 17:39:50 -05:00
Åke 5555fa398d
Merge pull request #2197 from forslund/feature/skills-startup-speedup
Skills process startup speedup
2019-07-10 16:30:48 +02:00
Åke Forslund b79bd0e317 Remove unused import of sys 2019-07-09 22:54:24 +02:00
Åke Forslund b0ddb9a74a Only report STT timing if transcription exists
To clean up the metrics log empty transcriptions from false activation
are no longer reported.
2019-07-09 22:54:06 +02:00
Åke 80b50598fb
Merge pull request #2196 from forslund/feature/skill-timing-report-skill_id
Add skill_id to skill handler timing report
2019-07-09 22:42:58 +02:00
Åke Forslund 94ab53f47e Handle sending skill manifest
Skill manifest is now sent on each startup if paired otherwise after successful pairing.
2019-07-09 16:52:27 +02:00
Åke Forslund d87ff3a535 Launch settings fetching in thread. 2019-07-09 16:52:27 +02:00
Åke Forslund cd16404455 Download skills if they're stale or in unknown state
Checks if the skills haven't been updated for more than 2 weeks or if
the last_download is undefined. last_download may be undefined if
the .msm file is missing or if the list of installed requirements is
missing so skill requirements may be missing.

This also makes sure the skills are normally loaded before the an update
attemt is tried.
2019-07-09 16:52:27 +02:00
Åke Forslund 58cab5cddb Add support for slowloading skills
Upgrade msm to 0.7.8

Using the new max_threads parameters to MycroftSkillsManager.apply() the
skill loading is reduced to 2 threads if it's during runtime while a
fast update (20 threads) are used if not all default skills are
installed to speed up getting core into a 100% operational state.
2019-07-09 16:52:10 +02:00
Åke Forslund c2c2377780 Add additional exceptions for may 2019-07-08 15:36:14 +02:00
Kris Gesling 946b7bf3de fix requests with non-month 'may' 2019-07-08 15:36:14 +02:00
Åke Forslund fe31564114 Remove unused imports 2019-07-08 14:41:09 +02:00
Åke Forslund 6466be63d8 Add skill_id to skill handler timing report 2019-07-08 09:12:20 +02:00
AJ Jordan 0bde03bc08
Recognize "confirm[ed]" as a word for "yes"
Fixes #2189
2019-07-04 15:40:03 -07:00
Åke Forslund fbcf731556 Remove broken auto-naming of resting_screen_handler
The automatic naming of the resting_screen_handler wasn't working (error
occured if no name was supplied)

Added test case for the function
2019-07-03 08:40:34 +02:00
Åke Forslund f0e397b32e Do not change process conf when preparing hotwords
A backwards compatibility piece of code creates a hotword from the
listener settings if the listener referes to a non-existing hotword.

This makes sure the generated config doesn't affect the loaded
configuration to avoid extra reloads of precise.
2019-07-01 20:58:22 +02:00
Åke Forslund 3a478c4a4d Update listener reload check
The reload check is now using a more reliable method and only a subset
of the configuration. Currently set to "listener", "hotwords", "opt_in"
and "stt".
2019-07-01 20:58:12 +02:00
devs-mycroft 0ec3dbee47 Version bump from 19.2.12 to 19.2.13 2019-07-01 11:21:44 +00:00
Åke Forslund 28e20617fd Remove 'update' field from skills data
Filter out update field from skills data when sending skills manifest
since backend will reject fields with unexpected data
2019-07-01 12:24:18 +02:00
Åke 12f13ef47c
Merge pull request #2177 from forslund/bugfix/settings-allow-retry-after-delay
Remove incorrect settings meta upload disable flag
2019-07-01 09:35:46 +02:00
Åke Forslund 83b4a91b8b Remove incorrect settings meta upload disable flag
This allows core to retry sending settings meta after a failed attempt
2019-06-29 21:00:15 +02:00
Åke Forslund 2f1f6a6005 Improve MycroftSkill docstring 2019-06-28 15:30:13 +02:00
Åke Forslund 25026e9f4c Add docs for the mycroft.util.format module
- Adds a module docstring to both format and parse module
- Update toc with a short description for these members
- Fix slight formatting issues
2019-06-28 15:30:13 +02:00
MichaIng 6bb8d4e0ae
German spelling: May => Mai 2019-06-26 19:30:07 +02:00
Åke a0f7fe2822
Merge pull request #2171 from forslund/bugfix/read-voc-lowercase
Read .voc files as lowercase
2019-06-26 10:35:11 +02:00
Åke 0a67544ea4
Merge pull request #2168 from forslund/feature/update-pychromecast
Update pychromecast to 3.2.2
2019-06-26 10:34:55 +02:00
Åke Forslund 04c0ebf820 Clean up handling of STT returning None 2019-06-25 11:37:01 +02:00
Åke Forslund 2a65623c6d Read vocab the .voc files as lowercase
A common error is to add capitalization in the .voc files when
translating them using the translate tool.
2019-06-25 11:05:44 +02:00
Åke 2b6c7132b1 Allow setting loglevel for speech / voice service (#2169)
Add create_echo_function line to activate the standard logging options
2019-06-21 13:42:32 -05:00
Åke 3b697519d0 Make sure help section shows everything (#2151)
- Use entire screen height
- Correct page number calculation
- Add constants to improve code readability
2019-06-20 17:04:08 -05:00
Chris Rogers a40218da18 Add lock/unlock actions 2019-06-20 12:02:34 +02:00
Chris Rogers 395c31cf29 Fix pep8 issues 2019-06-20 12:02:34 +02:00
Chris Rogers e1a2de7046 Add locate 2019-06-20 12:02:34 +02:00
Chris Rogers c966dbe5bd Add basic state support 2019-06-20 12:02:33 +02:00
Chris Rogers 44d51d15f3 Add speak support 2019-06-20 12:02:33 +02:00
Chris Rogers 3602ff8e87 Begin support for state queries 2019-06-20 12:02:28 +02:00
Åke Forslund 62b115e22c Update pychromecast to 3.2.2
pychromecast needed to be updated to fix pip package version conflict
when using streaming google STT.

Minor issues with startup of audio needed to be handled, mainly adding
explicit waits to ensure commands would be accepted
2019-06-20 08:59:27 +02:00
Åke Forslund 5211e51ec0 Remove requirement for seek_methods 2019-06-14 13:42:34 +02:00
Åke Forslund 39c844a257 Update old style metaclasses
the old "__metaclass__" has been ignored since the switch to python 3
this restores the metaclass functionality by updating it to the new
class kwarg syntax
2019-06-14 12:56:48 +02:00
David Wagner 4aab06d94a Docstrings 2019-06-13 09:52:31 -05:00
David Wagner d962240405 PEP8 2019-06-13 09:13:41 -05:00
David Wagner e9f68fea55 Only import google-cloud-speech if GoogleCloudStreamingSTT class is used. 2019-06-13 08:51:16 -05:00
David Wagner b585b3bd1b Merge branch 'dev' into feature/google-streaming-stt
# Conflicts:
#	mycroft/client/speech/listener.py
2019-06-13 08:31:44 -05:00
David Wagner 5f18b12617 Add back self.text 2019-06-13 07:17:08 -05:00
David Wagner 89a9ea16e2 Whitespace! 2019-06-11 17:41:06 -05:00
David Wagner bd2c1d802d PEP8 and remove fallback_stt 2019-06-11 17:35:50 -05:00
David Wagner d3c9ca4161 Remove comments 2019-06-11 17:32:21 -05:00
David Wagner 85931f43fc Google imports 2019-06-11 17:01:02 -05:00
David Wagner ab3c75f1f8 Google streaming 2019-06-11 17:00:47 -05:00
David Wagner 20d58e5724 DeepSpeech streaming 2019-06-11 17:00:16 -05:00
David Wagner c9dc14d528 StreamThread and StreamingSTT abstract classes 2019-06-11 16:59:45 -05:00
Åke aa70acd3f9
Merge pull request #2152 from forslund/feature/skill-manifest-safety
Skill manifest upload checks
2019-06-11 22:22:58 +02:00
Åke 604867201c
Merge pull request #2158 from MycroftAI/feature/time-to-system
Add mycroft.util.time.to_system()
2019-06-11 17:19:27 +02:00
Steve Penrod d80081d6b6 Remove unused subprocess module 2019-06-10 22:43:39 -05:00
Steve Penrod 5fb204fa1c Add mycroft.util.time.to_system()
Pulling method originally implemented in the default Mycroft skill-alarm, but useful by many for
converting a different timezone to whatever the native timezone is on the host machine.
2019-06-10 22:38:33 -05:00
David Wagner 22fc377086
Merge pull request #2149 from JPEWdev/feature/streamingstt
Feature/streamingstt
2019-06-10 21:10:06 -05:00
David Wagner a5526410c0
audio -> message rename 2019-06-10 20:59:10 -05:00
David Wagner 16248ee313 Initial Google Streaming STT implementation off of PR 2149 with dev logs scattered about 2019-06-10 17:32:38 -05:00
Steve Penrod 8ca4bb8343
Remove abstractmethod for MycroftSkill.stop()
The MycroftSkill.stop() method does not need to be implemented by the majority of skills, no reason to 'require' its implementation with an abstractmethod.
2019-06-10 13:15:59 -05:00
Joshua Watt 7bbfe0c9fb Add Streaming DeepSpeech Server STT Backend
Implements a STT backend for a DeepSpeech server that accepts streaming
requests. For example: https://github.com/JPEWdev/deep-dregs
2019-06-09 22:28:09 -05:00
Joshua Watt 601eeb6bdc Implement streaming STT framework
The initial framework for live streaming Speech to Text. STT derived
classes now can report that they support live streaming via their
"can_stream" property. If True, the following member functions will be
called on the object:

stream_start() - Called when a stream is starting. Should setup any
persistent state required to process speech to text.

stream_data(chunk) - Called when a chunk of audio data has been
captured.

stream_stop() - Called when a stream should be stopped. Should tear down
any state setup with stream_start(). Note that this may be called at
anytime (even if stream_start() has not been called).

Note that the execute() API is still used to get the text utterance from
the class.

A typical sequence of calls would be:

 stream_start()
 stream_data(...)
 stream_data(...)
 stream_data(...)
 stream_data(...)
 ...
 execute(...)
 stream_stop()
2019-06-09 22:28:09 -05:00
Chris Rogers d71f67f7ea Allow scheduling events a fractional number of seconds in the future 2019-06-09 22:13:44 -04:00
Åke Forslund f5aec8566d Handle badly formatted skills.json data
- Handle missing blacklist field
- Handle missing skills field
- Raise error if input is of incorrect type
2019-06-09 11:20:03 +02:00
devs-mycroft bac5c76398 Version bump from 19.2.11 to 19.2.12 2019-06-06 11:49:35 +00:00
Åke 626c69bc1d Skill settings cleanup (#2140)
* Handle DelayRequests when uploading blank settingsmeta

* Move Api methods to DeviceApi

This includes delete, put and get skill settings/meta

* Cache skill settings for 30 seconds

The skill settings are cached to reduce number of requests to the backend and increase skill loading speed.

* Remove _request_other_settings method

The endpoint is not used anymore

* Fix issue when the settingsmeta fails to load

Remove an old reference to "BLANK_META" left behind in the exception handler for failing to load settingsmeta.
2019-06-05 18:45:15 -05:00
Åke 72ceed4377 Fix usage of mtd before assignment (#2145)
When opt in is set and local saving of the file no mtd would be generated and the cause a undefined variable exception. This generates metadata if it's missing
2019-06-05 18:43:45 -05:00
Steve Penrod 115bf77763 Restored ability to store wakewords locally (#2141)
* Restored ability to store wakewords locally

The code that handles the local save of wake words configuration -
"record_wake_words" - was removed some time ago.  This restores that
capability.


Add the following to mycroft.conf
  {
    "listener": {
       "record_wake_words": true
    }
  }

Then restart Mycroft.  It should begin saving .wav files under the
/tmp/mycroft_wake_words directory.

The filename, will be  filename structure is: 

<accountId>_<engine>_<model>_<name>_<sessionId>_<time>.wav


* Add documentation for 'record_wake_words' and improve the doc for
'save_utterances'.
2019-05-31 16:07:50 +02:00
Aditya Mehra b08f090131 Add System QML support for HTML displays (#2138)
Add SYSTEM_HtmlFrame support for html-url and html-raw and override option for all system qml displays
2019-05-31 12:59:46 +02:00
Åke 6357513970 GUI updates (#2114)
* Catch the new system.gui.user.interaction

This will in turn trigger the gui.page_interaction similar to the page flip but page_number will be None

* Fix issue when adding pages

Seems like appending would fail at times

* Add lock around namespace modifications

* Improve argument description for override_idle
2019-05-31 03:44:09 -05:00
ChristopherRogers1991 b5279e480b
Merge pull request #2133 from forslund/feature/yaml-loader
Use SafeLoader to load settingsmeta yaml
2019-05-27 06:57:46 -04:00
Åke Forslund 21efb0fd69 Use yaml.safe_load() to load settingsmeta yaml
safe_load limits the amount of custom methods that can be supplied with
the yaml and supports the basic yaml features.
2019-05-27 12:25:42 +02:00
devs-mycroft ea9a7661fa Version bump from 19.2.10 to 19.2.11 2019-05-23 19:38:24 +00:00
Åke b1348de6f7 Feature/msm 0.7.6 (#2136)
* Log error when creating Padatious

* Update msm to v0.7.6

This handles connection errors during the startup procedure and improves
the skill_gid when no network is available
2019-05-23 10:16:37 -07:00
Åke 86df2cefd4 Don't create skill settings for Padatious Service (#2132)
Padatious is registered as a FallbackSkill and was pushing settings to
the backend.

This change allows Padatious to flag to the MycroftSkill class
that no settings should be created. This is done via the new optional
MycroftSkill parameter use_settings.
2019-05-23 10:14:08 -07:00
devs-mycroft eafeecd5ab Version bump from 19.2.9 to 19.2.10 2019-05-23 00:17:08 +00:00
Steve Penrod afa3ca3215
Pass the device id as part of the refresh sequence (#2134)
Having the device uuid in the packet along with the refresh token is
useful when debugging and recovering from unusual protocol failure
scenarios.
2019-05-22 16:37:03 -07:00
devs-mycroft 68eb6ab4a2 Version bump from 19.2.8 to 19.2.9 2019-05-22 11:45:32 +00:00
Åke bf6e363812
Revert "Support chopping old audio via precise upgrade" 2019-05-22 12:52:57 +02:00
devs-mycroft cbf3c41cce Version bump from 19.2.7 to 19.2.8 2019-05-22 08:24:06 +00:00