Commit Graph

412 Commits (c6b1e3dc92c2e6e41bd5e3f7ca465ecdfb43a9b7)

Author SHA1 Message Date
Åke Forslund fcc4df6351 Clear msm device_skill_state before update/upload
Make sure to re-read the device_skill_state from disk before doing
changes so no information is lost.
2019-09-20 08:07:03 +02:00
Åke Forslund 9423f920c4 Update test cases to properly mock the DeviceApi 2019-09-18 08:02:29 +02:00
Åke Forslund f7c4700343 Remove log checks 2019-09-17 11:24:10 +02:00
Chris Veilleux 9c0c20e96d added deprecation warning for settingsmeta fields no longer used. 2019-09-17 11:24:10 +02:00
Chris Veilleux 02a6f00b03 new log message indicating that a skill got new settings from the backend 2019-09-17 11:24:10 +02:00
Chris Veilleux fa1db1b9cf changed device API to hit new settings retrieval endpoint. 2019-09-17 11:24:10 +02:00
Åke Forslund 30104b58c1 Fix broken tests
- Correct settingsmeta upload endpoint
- Remove test for delete settingsmeta endpoint

- Fix usage of Pathlib for python 3.4 and 3.5
2019-09-17 11:24:10 +02:00
Chris Veilleux b1a63638c1 implemented a stop-gap change to keep the skill API from breaking 2019-09-17 11:24:10 +02:00
Chris Veilleux 5c742d2ed0 complete rethink of how settings and settingsmeta are handled in core. 2019-09-17 11:24:10 +02:00
Åke Forslund 7346e4d1b5 Add status queries to the skill process
mycroft.skills.is_alive: The service is started and priority skills are
loaded.
mycroft.skills.all_loaded: All skills on the system has been loaded.
2019-09-13 17:52:21 +02:00
Åke Forslund 3b2c7267e7 Rename Message type arg to msg_type
Name change to remove collision with the builin type.
2019-09-02 13:30:55 +02:00
Åke Forslund edc6192124 Reduce complexity of EvaluationRule
Creates rules.py containing logic for the small rule snippets for each
entry in the json
2019-09-02 10:03:45 +02:00
Åke Forslund f35ccae83b Fix broken startup log capture 2019-09-02 10:03:45 +02:00
Åke Forslund 69231c5ed1 Make execute_test less complex
Split the long function into several smaller ones just retaining the
main logic.
2019-09-02 10:03:45 +02:00
Åke Forslund 98c1a74ce8 Add dummy wait_for_response() method to test emitter 2019-09-02 10:03:45 +02:00
Åke Forslund 93e4719c8b Add test case for the handle_enable/disable_intent 2019-08-31 08:57:38 +02:00
Åke Forslund 077df67479 Disentangle event scheduler interface from skill 2019-08-30 13:32:00 +02:00
Åke Forslund 2d95ed9e35 Move complexity to IntentServiceInterface
Move much of the complex methods for registering intents to the
IntentServiceInterface to reduce bloat of MycroftSkill
2019-08-30 13:00:26 +02:00
Åke Forslund 245a4cb698 Refactor adapt intent data loading routines
- The data loading no longer require the bus
- Add an intent service interface class for better testing
- Update test cases
2019-08-30 13:00:26 +02:00
Åke Forslund 7393d9a670 Create container class for tracking skill handlers
This container remembers registered skills and allows unregistering
all handlers connected to a skill at shutdown.
2019-08-30 13:00:26 +02:00
Åke Forslund 2b3bd98d94 Rename test file for mycroft_skill to match 2019-08-30 13:00:26 +02:00
Åke Forslund b28d63cf71 Make register_intent decorator register all intent types
This makes the register_intent decorator work for all types of intents,
both Adapt and Padatious.
2019-08-30 13:00:26 +02:00
Åke Forslund f5cdeb76ce Move open_intent_envelope to intent_service 2019-08-30 13:00:26 +02:00
mathmauney 3c49608dfb See if builtins fixes the failure 2019-08-27 11:00:15 +02:00
mathmauney ea16ef4436 Switch mock to unittest.mock 2019-08-27 11:00:08 +02:00
Chris Veilleux 79f4ec712c Added licensing headers to files missing them. 2019-08-23 16:07:46 +02:00
Chris Veilleux ebfd367b98 Changed skill manager and updater to reflect changes to MSM.
Cached the MSM creation logic to improve performance.
2019-08-23 16:07:26 +02:00
Åke Forslund 8996972e78 Fix reload_allowed check
Fix logic precedence error and add test for the previous failing
condition.
2019-08-21 16:33:55 +02:00
Chris Veilleux 3bd3dd1bed Refactor skill manager (#2237)
Split skill_manager into three separate classes, SkillManager, SkillUpdater and SkillLoader splitting the responsibility into logical units

* Split the SkillManager.__init__ code to determine the download times into a new method
* Make docstrings consistent and PEP257 compliant.  Also fixed a couple of spelling errors
* fixed two issues introduced in the previous refactoring
* removed unnecessary assignment of an instance attribute to a local variable
* updated the unit test to mock out code that reaches outside of core, like MSM and the configuration manager.
* add several unittests and refactored load_priority method.
* add a test for the _get_last_modified_date function.
* add "quick" argument to docstring
* removed unused import
* new class containing the logic to periodically update/install skills and send skill manifests to the backend.
* import MsmException from where it is defined, not from the skill manager.
* add some logging to the skill updater
* remove code now in SkillUpdater from SkillManager
* added imports to __init__.py to define the API into the message bus package
* new base class for unit tests and module for reusable mocks
* new skill loader class that will replace the _load_or_reload_skill() method in the SkillManager class.
* moved skill loading logic from core.py into skill_loader.py, resulting in some refactoring of skill loader and skill manager.  change unit tests to match.
* added back some spacing that was inadvertently removed.
* change skill tester to use new SkillLoader class.
* Separate reload required check from performing reload to make logic easier
to follow
* Track skills that failed to load to handle infinite loop at first load
if skill fails to load
* Allow reloading skills that has failed to load
* Simplify first load of skills
- create activate, deactivate and unload methods for skill_loader
objects
- add sanity checks before activating and deactivating skills
- Update activation/deactivation test cases
2019-08-20 12:02:39 +02:00
Åke Forslund b68fff3d0c Minor cleanup of api tests
- remove duplicated code for creating identity mock
- separate the Api class tests from the rest of the tests
2019-08-11 08:57:36 +02:00
Åke Forslund fed4fb4d5d Add test cases for skill meta api calls 2019-08-10 08:10:10 +02:00
Åke a140efe8f7
Merge pull request #2234 from c0r73x/dev
Some Swedish additions
2019-08-02 07:31:59 +02:00
Chris Veilleux d1915d3f95
Merge pull request #2180 from forslund/feature/is_paired-fail-early
Make is_paired fail early if no uuid in identity
2019-07-29 13:57:31 -05:00
c0r73x e88e7c007d More fixes to swedish numbers 2019-07-27 20:27:51 +02:00
c0r73x 4f92361bcc Added test_format_sv.py 2019-07-25 22:45:30 +02:00
Åke Forslund b4c99b83ce Add basic tests for message bus client
Inital tests checks that the url generated from config is correct and
that a websocket client is created.
2019-07-24 08:50:28 +02:00
Åke Forslund b9fddc7ad5 Split off is_paired into separate test class
- Add BackendDown test
2019-07-23 11:37:06 +02:00
Åke Forslund e87cf16a0d Make is_paired fail early if no uuid in identity
Refactors code so no request is sent to backend if the local identity
file is empty / has no uuid. Since if this part is missing core already
knows that it's not paired correctly.
2019-07-23 11:36:55 +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
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
Kris Gesling 946b7bf3de fix requests with non-month 'may' 2019-07-08 15:36:14 +02:00
Åke Forslund 44c0a0e430 Restore sys.path after test_register_decorator
Issue detected by pyflake, the original sys.path was never restored
2019-07-03 08:57:38 +02: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 ff3849ce4d Fix failing test case 2019-07-01 22:55:40 +02:00
Åke d1ac0ca85d Add gui related messages to list of hidden messages (#2170)
These currently mainly clutter up the logs
2019-06-20 17:01:20 -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
David Wagner 22fc377086
Merge pull request #2149 from JPEWdev/feature/streamingstt
Feature/streamingstt
2019-06-10 21:10:06 -05:00
David Wagner 9d8264b20d
Shorten two lines 2019-06-10 18:04:38 -05:00
Chris Rogers bdf2bca365 assertEquals -> assertEqual
assertEquals has been deprecated.
2019-06-10 09:10:59 +02: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