Åke Forslund
ed4c6f7248
Fix resetting of converse state on STT failure
...
The handler was silently failing when the STT doesn't receive any data.
2020-03-02 11:25:23 +01:00
Åke Forslund
5867b4fe2e
Remove debug logging of stop message context
2020-02-27 14:33:34 +01:00
Chris Veilleux
baf194c556
remove deprecated Settings class and any code in core that references it.
2020-02-27 08:07:07 +01:00
Åke Forslund
ef76f685bf
Only register for stop events if skill uses them.
2020-02-26 07:25:45 +01:00
Åke
1afedb2dd2
Merge pull request #2468 from JarbasAl/feat/intent_api
...
intent api
2020-02-24 08:40:36 +01:00
jarbasal
09cc3f6294
cleanup
2020-02-24 08:23:35 +01:00
jarbasal
3728e2013b
norm utterances
2020-02-24 08:23:35 +01:00
jarbasal
74d07f0fdc
Fix lang parameter
2020-02-24 08:23:26 +01:00
jarbasal
1e00347834
message fix
2020-02-24 07:46:46 +01:00
jarbasal
befab62a58
get_skill from utterance
2020-02-24 07:46:46 +01:00
jarbasal
d3037f2ba1
move to intent_service_interface
2020-02-24 07:46:46 +01:00
jarbasal
f1c55cc809
padatious match
2020-02-24 07:46:46 +01:00
jarbasal
16f91c8ebe
add regex
2020-02-24 07:46:46 +01:00
jarbasal
532bcc2b2a
intent api
2020-02-24 07:46:46 +01:00
Åke Forslund
e1fa0e3ad2
Set context from previous message when doing converse
2020-02-22 09:35:03 +01:00
Åke Forslund
acf3b96aa2
Make padatious service forward the intent call
2020-02-21 08:26:47 +01:00
Åke Forslund
1a0432255c
Handle missing message idents in converse
...
Handle the case where context exists but without ident
2020-02-21 07:57:46 +01:00
jarbasal
f209afb021
Move dig_for_message to messagebus submodule
2020-02-15 15:35:43 +01:00
jarbasal
fc9e254eef
common iot message context
2020-02-15 15:35:43 +01:00
jarbasal
f4a96e6c22
Update Unittests and fix pep8
2020-02-15 15:35:43 +01:00
jarbasal
cc8029a357
pass context in scheduled events
2020-02-15 15:35:43 +01:00
jarbasal
ef556557ad
Fallback skill forward messages
2020-02-15 12:52:10 +01:00
jarbasal
0a560602c7
Use forward to send messages in MycroftSkill
2020-02-15 12:50:49 +01:00
Åke
47038f575e
Merge pull request #2462 from forslund/test/cqs
...
Tests for CommonQuerySkill
2020-02-07 08:34:18 +01:00
Åke
74c6a483fd
Merge pull request #2459 from forslund/test/common-play-skills
...
Common play skill tests
2020-02-07 08:33:54 +01:00
Åke
d269a49a16
Merge pull request #2422 from forslund/refactor/dialog
...
Refactor mycroft.dialog
2020-02-07 08:33:25 +01:00
Åke Forslund
f759903dcb
Deprecate DialogLoader class
...
The DialogLoader class has been replaced by the simpler load_dialogs
function.
2020-02-05 17:04:37 +01:00
Åke Forslund
3fa6e6e309
Use wait_for_response to retreive track info
2020-02-05 13:13:17 +01:00
Åke Forslund
020ee329f6
Allow AudioService.queue to accept mime info
2020-02-05 13:13:17 +01:00
Åke Forslund
b2c920f031
Minor docstring cleanup
2020-02-05 13:13:17 +01:00
Åke Forslund
6740eea82c
Fix formatting of docstrings
2020-01-26 18:17:37 +01:00
Åke Forslund
9abb00f681
Fix func checking if a platform supports visuals
2020-01-26 18:17:37 +01:00
Åke Forslund
9563bff162
Add readthedocs docs for settings_change_callback
2020-01-15 08:39:15 +01:00
andlo
39de6b655e
pep8 fix
2020-01-07 16:53:37 +00:00
andlo
7b4891d07a
enable seting for patadious single_thread in mycroft.conf
2020-01-06 19:32:29 +00:00
Åke Forslund
555478c33f
Add self.root_dir to readthedocs documentation
2020-01-03 10:45:39 +01:00
Åke Forslund
9628a5b5f4
Fix settingsmeta upload start race condition
2019-12-19 10:03:36 +01:00
Åke Forslund
d45edcd613
Add priority skill's settingsmeta
2019-12-19 10:03:14 +01:00
Åke
184508a020
Merge pull request #2370 from forslund/feature/settingsmeta-queue
...
Stabilize skill settings download
2019-12-18 12:41:16 +01:00
Åke Forslund
ec1d35d1b7
Fixes from code review
...
- Use reload status directly instead of instance check
- Move manifest posting to start_upload method
2019-12-18 12:05:40 +01:00
Åke Forslund
1e7314d7ca
Update skill manifest when a skill is removed
...
When skills are removed the skills manifest is updated using msm and
then sent to the backend.
2019-12-18 12:05:40 +01:00
Åke Forslund
146a8c1434
Get skill_gid more reliably
...
If skill directory doesn't exist in current cache try to fetch a new
copy.
2019-12-18 12:05:40 +01:00
Åke Forslund
f5685bde96
Simplify
...
Skip the queue thread, do upload in series with skill load/reload.
2019-12-18 12:05:40 +01:00
Åke Forslund
fa1bdfdda7
Send manifest before starting settingsmeta upload.
...
Minor restructuring moving the enqueuing of settingsmeta upload to after
updating the skills manifest.
2019-12-18 12:05:40 +01:00
Åke Forslund
c11c9756ce
Add queue system to send settingsmeta
...
The queue will store all settingsmeta upload calls and execute them
after pairing can be verified.
Starts settings download after upload has started. When settings meta upload
has started for all skills the skill download process is triggered.
This guarantees that the settingsmeta skill_gid has been populated
properly before skills try to figure out which part of the skills data
belongs to them.
Add docstrings to upload queue
2019-12-18 12:04:57 +01:00
Philipp Fischbeck
3f73fb50af
Fix typo in MycroftSkill documentation
...
Change "https://https:// " to "https://"
2019-12-15 16:42:41 +01:00
domcross
7af161fd03
Fallback to 'en-us' when resource fails
...
When mycroft_skill.find_resource fails to load a resource for self.lang
fall back to lang 'en-us'
as most skills/resources are available in english by default.
==== Fixed Issues ====
2019-12-05 10:21:54 +01:00
Åke
6bd6441da2
Merge pull request #2393 from MycroftAI/feature/geolocation-api
...
Feature/geolocation api
2019-11-26 11:10:05 +01:00
Åke
f1327f0973
Merge pull request #2376 from forslund/bugfix/shutdown-on-skill-remove
...
Fix Shutdown of removed skills
2019-11-07 23:08:45 +01:00
Chris Veilleux
183649ac5e
Merge remote-tracking branch 'remotes/origin/dev' into feature/geolocation-api
2019-10-31 13:11:58 -05:00
Åke Forslund
3e905165e6
Fix Shutdown of removed skills
...
Verify that skill directory exists before writing to ensure that the
shutdown method doesn't throw exception if a skill is unloaded due to
being removed.
2019-10-31 11:40:41 +01:00
Åke Forslund
d4a7193fe8
Remove circular reference during skill shutdown
...
This cleans up the extra skills references making the ref count trigger
correctly.
2019-10-31 09:38:46 +01:00
Åke Forslund
4bf0e89fb5
Update docstrings to match behaviour
2019-10-17 11:33:25 +02:00
ChanceNCounter
738ba6cf00
edit for pep8 compliance ( #15 )
2019-10-17 11:07:51 +02:00
jarbasal
978ece53ca
feat/ask_selection
2019-10-17 11:07:51 +02:00
David Wagner
1a9a51fe56
Merge pull request #2354 from forslund/bugfix/settings-delitem
...
Add missing __delitem__ method
2019-10-07 10:44:48 -05:00
Åke Forslund
24d6cf9ea0
Add missing __delitem__ method
...
The delitem method is apparently used, for example by the alarm skill
2019-10-04 20:43:46 +02:00
Åke Forslund
08d38dea75
Remove event before running event handler
...
Allow events to reschedule themselves. The reference is removed before
the handler is executed to not remove anything added by the handler.
2019-10-04 18:29:11 +02:00
Åke
15233f8929
Merge pull request #2336 from forslund/feature/load-skill-settings-once
...
Remove duplicate load of skill settings
2019-10-03 19:46:11 +02:00
Åke Forslund
425feb0590
Store correct function for once events
...
The handler was always stored even when the event was a once event and
thus was wrapped in once_wrapper.
This handles the once correctly.
2019-09-30 13:31:53 +02:00
Åke Forslund
9254ee0229
Remove duplicate load of skill settings
...
Instead of loading skill settings from disk twice, a copy is made into the
_initial_settings member after load.
2019-09-29 18:39:07 +02:00
Chris Veilleux
364c3991e7
fixed a spelling error
2019-09-28 12:55:31 -05:00
Chris Veilleux
eca875558a
added log message and docstring to help demystify regex intent handling
2019-09-28 12:21:28 -05:00
Chris Veilleux
f16989c2ec
Add log messages that provide insight into the disambiguation behavior
2019-09-28 12:20:22 -05:00
Chris Veilleux
5980779e48
Refactored module level docstring and import ordering
2019-09-28 12:17:12 -05:00
Åke
d30c50e752
Merge pull request #2283 from forslund/refactor/config-properties
...
Replace config properties to simpler instances
2019-09-26 14:51:56 +02:00
David Wagner
7cb1ca7282
Remove unused methods
2019-09-25 10:58:51 -05:00
David Wagner
3fc389dbf3
Remove ntp sync reboot
2019-09-24 20:35:11 +00:00
Åke
6c228d00a9
Merge pull request #2320 from MycroftAI/bugfixes/skills-manifest
...
Bugfixes/skills manifest
2019-09-20 22:57:57 +02:00
Åke Forslund
62bba61da0
Make sure skill manifest is synced with backend
...
Send skill manifest all startups
2019-09-20 16:40:30 +02:00
Åke Forslund
c6b1e3dc92
Make logging a little easier to decipher
2019-09-20 12:20:46 +02:00
Å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
2cb2c56572
Install priority skills and save info
...
Use the msm.install method to install the priority skills so the skill
details are registered in the manifest
2019-09-19 20:07:21 +02:00
Åke Forslund
e0cb16eab8
Clean up skill_manager exceptions
...
- BaseException -> Exception
- Remove unused vaiables
2019-09-19 20:07:21 +02:00
Åke Forslund
c016903b77
Update skills manifest if a skill is reloaded.
...
When a skill is reloaded it is quite possible that a new skill gid has
been assigned to it and the backend needs to be informed of the change.
2019-09-19 20:07:21 +02:00
Åke Forslund
3474d725b8
Stop settingmeta upload on skill shutdown
...
This makes sure to shutdown any Timer handling settingsmetadata upload
on skill shutdown to make sure no duplicates are running.
(Easily occurs when a skill gid doesn't match the one sent in skill
manifest)
2019-09-19 15:25:55 +02:00
David Wagner
af08f82aad
Merge pull request #2314 from forslund/bugfix/no-skill-gid
...
Restructure to get skill_gid after startup
2019-09-18 13:22:12 -05:00
Åke Forslund
b9097e43f2
Restructure to get skill_gid after startup
2019-09-18 19:59:13 +02:00
Åke Forslund
4860b5657f
Add a safety harness in skill_manager main loop
...
This captures any unhandled expressions and will at least make sure
they're logged properly. (Exceptions in threads are mostly not printed
to stdout).
This sleeps slightly longer than normal (10 seconds) and then tries to resume
normal operation.
2019-09-18 19:55:39 +02:00
Åke
35bf4c88b9
Merge pull request #2312 from MycroftAI/bug/settingsmeta-upload-device-uuid
...
settingsMeta API call to be issued without a device ID in the URL.
2019-09-18 10:01:40 +02:00
David Wagner
f4865286ab
Merge pull request #2299 from forslund/bugfix/skills-reload-error
...
Catch exceptions when reloading skills
2019-09-17 19:24:04 -05:00
Chris Veilleux
a5af2adb6d
fixed an issue where a potential race condition can cause the settingsMeta API call to be issued without a device ID in the URL.
2019-09-17 15:31:48 -05:00
Åke
fa6d826244
Merge pull request #2311 from forslund/bugfix/gotta-catch-em-all
...
Catch all exceptions from upload device info
2019-09-17 12:07:32 +02:00
Chris Veilleux
9c0c20e96d
added deprecation warning for settingsmeta fields no longer used.
2019-09-17 11:24:10 +02:00
Chris Veilleux
0d897cf4e8
don't emit settings change event if there are no settings
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
1e5c2986d3
fix bug where saving settings to disk crashed when the settings passed to the function are a instance of the Settings class.
2019-09-17 11:24:10 +02:00
Chris Veilleux
21dd5b2bed
fixed a bug with skill settings where the last download value was not properly initialized. added some logging
2019-09-17 11:24:10 +02:00
Chris Veilleux
4cfd48104d
deal with empty settings file
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
826c822a74
only save settings to disk if a change is detected.
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
Chris Veilleux
bbb288a5f0
small typo fix
2019-09-17 11:15:39 +02:00
Åke Forslund
e9922c0fff
Catch all exceptions from upload device info
2019-09-17 08:13:58 +02:00
Åke Forslund
5457c265f3
Handle errors when updating device attributes
...
Capture the correct exceptions when updating device version and
enclosure type. Switches from BackendDown to ConnectionError and
HTTPError.
2019-09-16 10:41:34 +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
jarbasal
5edf464808
bugfix/adapt munging
2019-09-13 02:06:18 +01:00
Åke Forslund
74be9a8a2e
Catch exceptions when reloading skills
...
- Explicitly catch FileNotFoundError
- Do a general catch and log for other exceptions
2019-09-11 14:20:22 +02:00
Åke Forslund
02714cdeaf
Don't kill global events when shutting down skill
...
During skill shutdown remove_all_handlers() was called on all registered
events. This would unregister all global events, such as settings
updating, stop for all skills.
Now the remove only will remove the instance connected to the skills
method.
2019-09-10 11:42:07 +02:00
Åke Forslund
32cfe0d5c4
Fix error enabling/disabling padatious intents
...
Padatious is still not the greatest at enabling / disabling intents but
it's slightly better.
2019-09-02 18:49:55 +02:00
Åke Forslund
c3c12d147a
Handle event scheduler methods without message arg
...
Fix issue when the handler is specified without an argument parameter.
2019-09-02 18:49:41 +02:00
Åke Forslund
e2d5b92bfe
Remove deprecated methods and checks
2019-09-02 11:45:32 +02:00
Åke Forslund
ce772dd1ae
Replace config properties to simpler instances
2019-09-01 12:18:27 +02:00
Åke Forslund
36eddc294f
Mark unused parts of tuples
...
- use the external iterator instead of accessing the member
2019-08-31 09:04:16 +02:00
Chris Veilleux
ed0b4f2719
self.registered_intents was moved to the IntentServiceInterface class but the instance attributes were not changed to reflect this. Also tidied up a few minor issues raised by linter.
2019-08-30 16:49:35 -05:00
Åke
75ad11b9d0
Merge pull request #2256 from forslund/refactor-split-mycroftskill
...
Refactor MycroftSkill
2019-08-30 18:21:13 +02:00
Åke Forslund
02b49edc99
Fix typo when unreferencing skill after failed load
2019-08-30 14:57:27 +02:00
Åke Forslund
077df67479
Disentangle event scheduler interface from skill
2019-08-30 13:32:00 +02:00
Åke Forslund
cbf2fc63a9
Remove skill logic from create_wrapper
...
- Remove once-logic from the default handler wrapper, no need to do it there.
- Add docstring for handle_wrapper
- add the on_start, on_end handlers and move skill logic to respective
handlers.
2019-08-30 13:00:26 +02:00
Åke Forslund
87d9512093
Update get_scheduled_event_status()
...
Use the more modern bus.wait_for_response()
2019-08-30 13:00:26 +02:00
Åke Forslund
c1d07bbe23
Add comments and clean up IntentServiceInterface
2019-08-30 13:00:26 +02:00
Åke Forslund
d461ffe63c
Update docstrings and variable names of EventSchedulerInterface
2019-08-30 13:00:26 +02:00
Åke Forslund
f081404ce3
Further cleanup
2019-08-30 13:00:26 +02:00
Åke Forslund
5e558647e7
Refactor translation methods
...
Move file reading logic into skill_data.py
2019-08-30 13:00:26 +02:00
Åke Forslund
e2ec2ef8d1
Reduce complexity of get_response()
2019-08-30 13:00:26 +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
5402f8ae22
Use remove_all_listeners when cleaning
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
a187a17d4d
Set MycroftSkill.root_dir in __init__()
...
This also removes the _dir member which cointains the same information.
2019-08-30 13:00:26 +02:00
Åke Forslund
f655152717
Minor cleanup of MycroftSkill
...
- Create separate method for regisetering mycroft system event handlers
- Fix some string concatenations
- Group acknowledge together with speak and speak_dialog
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
Åke Forslund
0759d6f8e1
Split of mycroft skill decorators into new file
...
Split of decorators from the mycroft_skill file and create a submodule
for mycroft_skill
2019-08-30 13:00:26 +02:00
Åke Forslund
a3429dbd96
Create EventSchedulerInterface class
...
Group event scheduler interface logic into subclass
2019-08-30 13:00:26 +02:00
Åke Forslund
2e82f64519
Populate root_dir in __init__ from file location
2019-08-30 13:00:26 +02:00
Åke Forslund
70307c073a
Fix stacktrace on use of deprecated config member
2019-08-24 12:06:49 +02:00
Åke Forslund
4d0e848965
Use from folder instead of dict lookup
2019-08-23 16:52:32 +02:00
Åke Forslund
6736513ae7
Fix SkillUpdater creator
...
- Since the bus emitter is currently not necessary it's set as an optional
parameter.
- Add proper class docstring
2019-08-23 16:52:31 +02:00
Chris Veilleux
48ca79f388
Improve scanning for decorated handlers
...
This will recurse down to MycroftSkill class but not include it. for
most skills this will mean only the methods / variables added by the
skill creator
2019-08-23 16:51:53 +02:00
Chris Veilleux
be79b193b4
changed to use newer version of msm_wrapper.
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
Åke Forslund
bd0456f4e6
Fix issue where skills fail during initialize()
...
An exception in skill's initialize method would be reraised and cause
the main loading routine to halt. This does not reraise the exception,
instead the instance reference is removed.
2019-08-21 10:11:47 +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
Kris Gesling
3cacdaaaab
Fix TypeError for number values in settings
...
In some instances, the backend returns number setting values as an integer rather than a string.
This has been seen in the wild but has been difficult to replicate. The circumstances under which it happens are still unclear. I was able to semi-consistently have a number returned as int from the [Severe Weather Skill](https://github.com/domcross/severe-weather-information-skill ) when editing an unrelated setting. To test, remove the 3 character country code (`[A-Z]{3} - `) from the service options of this skill .
This seems to be the quickest fix for it, but worth investigating further from the backend.
2019-08-17 08:36:00 +09:30
David Wagner
db2ea07f18
Merge pull request #2236 from forslund/bugfix/system-update
...
Allow startup if update attempt occurs
2019-08-12 14:31:34 -05:00
Kris Gesling
b357874c25
Merge pull request #2235 from MycroftAI/bugfix/padatious-detach-unregistered
...
Handle removing unregistered intents
2019-08-01 08:35:39 +09:30
Åke Forslund
e9cc683dbe
Allow startup if update attempt occurs
...
update_attempt will block waiting for the update to complete and the
update will shutdown the running skills process if an update is needed.
2019-07-26 17:40:59 +02:00
Åke
7ebf58919e
Merge pull request #2233 from forslund/refactor/event-emitter
...
Small cleanup of the event scheduler
2019-07-26 17:10:23 +02:00
Åke Forslund
13db3d32a3
Handle removing unregistered intents
...
This small change adds a check that the intent has been registered
before removing it.
If an unregistered intent was removed padatious would silently throw an
exception due to a list operation error. But when run synchronously from
the skill tester this silent exception was actually loud causing skills
to fail to load.
2019-07-26 16:04:16 +02:00
Åke
5eba242487
Merge pull request #2221 from forslund/refactor/split-skills-core
...
Split mycroft.skills.core
2019-07-26 08:54:26 +02:00
Chris Veilleux
0bde1bc9df
Refactor skill service ( #2220 )
...
Major refactoring of the skills startup sequence
- Restructure to a less nested structure
- Remove usage of globals by wrapping a lot of state variables into a class this allows for things like caching a negative pairing status throughout the startup process
2019-07-26 08:53:27 +02:00
Åke Forslund
1f6adda6fd
Small cleanup of the event scheduler
...
- Update docstrings
- Fix camelcase member
2019-07-25 08:44:20 +02:00
Åke Forslund
846723cca0
Limit creation attempts of msm-lock
...
the msm-lock was created in global scope making all mycroft processes
trying to create it. This moves init to actual usage of the lock
2019-07-24 12:16:05 +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
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
Å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
David Wagner
4b480dcf32
Add mycroft_mark_2pi to platforms needing ntp sync
2019-07-12 06:56:35 -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
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
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
Å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
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
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
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
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
Chris Rogers
d71f67f7ea
Allow scheduling events a fractional number of seconds in the future
2019-06-09 22:13:44 -04: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
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
Å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
Åke Forslund
c3ac9d8ca7
Remove the delete metadata calls when updating settings
...
The calls are not implemented and functionality will likely change.
2019-05-21 17:21:45 +02:00
Åke Forslund
2208ee178c
Switch to getting skill_gid from msm skill entry
2019-05-21 09:23:02 +02:00
Åke Forslund
4518a11528
Add safety around skillMetadata
...
skillMetadata could be accessed in settings without it when checking if remote update was needed.
2019-05-18 08:29:26 +02:00
Åke Forslund
6eb2aefbaa
Delete remote settings before pushing
...
- restore storing / loading uuid
- use uuid to delete before pushing settingsmeta
2019-05-18 08:29:26 +02:00
Åke Forslund
4a75526de7
Check both endpoints for settings
2019-05-18 08:29:26 +02:00
Åke Forslund
93a0b31b4e
Switch endpoint for fetching settings
...
use the userSkill endpoint instead of skill endpoint to always be able
to get settings no matter who the owner is.
2019-05-18 08:29:26 +02:00
Åke Forslund
f6347ae47c
Replace hashed meta with skill_gid as identifier
...
This also removes the notion of an owner skill and all skills may update settings on the server.
2019-05-18 08:29:26 +02:00
Åke Forslund
693bf2c699
Remove BLANK boilerplate content
2019-05-18 08:29:26 +02:00
Åke Forslund
56ed5a657f
Re-add support for skill_gid in settingsmeta upload
2019-05-18 08:29:26 +02:00
Aditya Mehra
eb32570efa
Feature/System_QML ( #2121 )
...
Add support for SYSTEM QML functions for show_text() and show_image()
The ui elements used are stored in the mycroft/res/ui folder
2019-05-16 09:09:01 +02:00
Aditya Mehra
ccb23f14bf
feature/enable sending qml ui over network ( #2106 )
...
Enable sending qml ui over network
2019-05-13 10:43:29 +02:00
ChristopherRogers1991
6dd16915a9
Allow settingsmeta to be a yaml file ( #2113 )
...
Allow settingsmeta to be a yaml file in addition to the current .json file
2019-05-13 09:34:39 +02:00
Matthew D. Scholefield
09e7a18b77
Merge pull request #2116 from forslund/feature/delay-on-422
...
Add delay on failure to upload skillsettingsmeta
2019-05-07 19:28:12 -05:00
Åke Forslund
0b11cdac0a
Add delay on failure to upload skillsettingsmeta
...
Mycroft-core won't retry for 5 minutes on a 422, 500 or 501 error.
This adds a DelayRequests Exception which will cause the settings
fetching Timer thread to sleep for 5 minutes
2019-05-07 14:50:17 +02:00
Chris Rogers
aaa1a7f55a
Add docs and fix IoTRequest repr
2019-05-06 15:57:49 -04:00
Chris Rogers
b3d6cc35c0
Add support for values
2019-05-06 15:57:49 -04:00