Commit Graph

656 Commits (65fcfcfcff67248829230823f6af91c5b14ce413)

Author SHA1 Message Date
Julien Kassar 24a80d60c3 Fix camel case splitting
Signed-off-by: Julien Kassar <github@kassisol.com>
2018-08-12 14:00:28 -04:00
Steve Penrod 609a09bbf3
Allow Padatious to override Adapt (#1713)
Allow a Padatious intent to override Adapt when it is VERY
certain that the utterance is directed at it.  (95% confidence
or greater.)  Right now that only occurs if the intent match
for the given phrase is perfect.

This solves this kind of issue:
* Adapt:  Matching on "Set" and "Alarm"
* Padatious: Handling "is an alarm set"

* Fix logic error for when no Padatious intent
2018-08-03 14:43:17 -05:00
Matthew D. Scholefield d49d991a84 Remove git locks when starting mycroft (#1715)
This is a preventative measure to fix errors with git lock files not being removed when devices are unplugged or processes are killed
2018-08-03 14:41:51 -05:00
Steve Penrod ec73b7d48e
Fix named event scheduling/deleting (#1705)
While working on the Alarm skill I discovered several issues with the
event scheduler.  This PR cleans up those findings and resolves several
other potential issues:

1) To avoid thread synchronization issues, the EventScheduler had several
queues which independently held objects to be added/deleted/updated.  However, the order of the events was undefined and got mixed since they were all batched together.  So, for instance, if skill code performed:
   self.add_event("foo", self.handle_foo)
   if SomeReason:
       self.cancel_event("foo")
The actual order of queue handling would perform Remove first, then Add which resulted in "foo" not being found for delete, but then added and left as an active event.

Now the EventScheduler protects the list using a Lock and the queues have been removed.  Modifications to the list happen immediately after obtaining the lock and are not batched up.

2) One-time events were triggered while the event was still in the EventScheduler list.  Now the entry is removed before invoking the handler.

3) Within the MycroftSkill.add_event(name, handler) is a local 'wrapper' method that actually makes the callback.  The MycroftSkill.remove_event(name) method attempted to find entries in the events list and the associated handler entries in the self.emitter to remove.  However, the emitter actually held the wrapper(handler), not the handler itself.  So the emitter handlers were left behind.

This was a quiet bug until the next time you scheduled an event of the same name.  When that second event finally triggered, it would fire off both the new and the old handler -- which snowballed in the 'skill-alarm:Beep' case, doubling and redoubling with every beep.

Now this cancels all the emitter listeners by name.  There is a very slim chance that someone has registered a listener with the same name, but since it is namespaced to "skill-name:Event" I think this is pretty safe.


Not technically related, but a failure that has been lurking for
some time and is a French unit test that doesn't work depending
on the time of day when the test is run.
2018-07-30 15:08:13 -05:00
Matthew D. Scholefield 3fbe12cc07
Make single thread log nicer 2018-07-26 18:57:36 -05:00
Steve Penrod 0eb29718f3 Remove commented-out code 2018-07-26 18:27:49 -05:00
Steve Penrod edc6ab1ed6 Immediately speak warning while Padatious trains
At startup, Padatious was blocking in the fallback while the
training occurred.  As a result, any attempts to use Mycroft
during that period would queue up rather than giving the
user feedback.  Now it immediately returns False, allowing
user notification to occur elsewhere.
2018-07-26 18:21:48 -05:00
Åke Forslund b60320bcae Fix updating padatious intents after intent reload
Training is called from wait_and_train with None as message, this commit adds propper handling for this case.
2018-07-19 14:06:58 +02:00
Åke c140d5b889
Merge pull request #1690 from MycroftAI/feature/ask-yes-no
Add new MycroftSkill.ask_yesno() method
2018-07-19 09:34:32 +02:00
Åke ad5ebcf63d Bugfix/unmunge (#1688)
* Fix cases where the unmunge misses keywords

The unmunge would invariably miss keys due to the fact that the dict is modified while being iterated. This breaks out the keys into a list before iterating through them to ensure that all original keys are checked.

* Clean up the unmunge function slightly
2018-07-19 02:03:43 -05:00
penrods b005ba6f59 Allow dialog param of get_response() to be a spoken string
This makes the dialog parameter dual-purpose.  It can be used as a
literal spoken string, or a dialog resource.  In the future the
announcement parameter can be retired.
2018-07-19 02:00:17 -05:00
Matthew D. Scholefield 0540229cc4
Merge branch 'dev' into feature/cleanup-setup 2018-07-18 10:44:41 -05:00
penrods 18ab343b80 Add new MycroftSkill.ask_yesno() method
New function allows simple yes/no queries to be asked, capturing common
affirmations (e.g. "yes", "yeah", "yep", "sure", ...) and rejections
("no", "nope", ...) that are consistent across all skills.

The method will return a normalized 'yes', 'no' or whatever else is spoken
for further parsing.  None is also possible.

This also adds the MycroftSkill.is_match() method to assist in matching
translated synonyms within an utterance.
2018-07-17 01:35:55 -05:00
Åke 9c8c6b8852
Merge pull request #1686 from JarbasAl/feature/padatious_enable_disable
Make it possible to enable/disable padatious intents
2018-07-14 11:52:12 +02:00
JarbasAI 0e121f8bcd allow disabling intent registered with decorator in initialize (#1685) 2018-07-14 11:36:16 +02:00
Åke Forslund fad890ff39 Clean up setup scripts
- Remove setup scripts for mycroft-skills-sdk since it's not used anymore
- Rename mycroft-base-setup.in/MANIFEST.in to setup.py and MANIFEST.in
- Remove skill-container, since it hasn't been used or kept up to date since 17.08 and the cli commands to remove and activate skills is easier to work with

==== Environment Notes ====
Small update of the packaging script is needed due to this change
2018-07-14 08:36:50 +02:00
jarbasal 56efe5e489 padatious enable/disable 2018-07-14 04:31:39 +01:00
jarbasal c4cdb85599 padatious enable/disable 2018-07-14 04:00:21 +01:00
penrods e0dc373915 Fix crash during initial skill download
When running on a platform for which there was not DEFAULT.platform
file in the mycroft-skills repo, the downloading of skills would
crash.  Now an informational message is shown and the DEFAULT
skills alone are loaded.
2018-07-06 01:42:16 -05:00
Steve Penrod 17aab53fae Enhance the behavior of the Mark 1 button (#1668)
The Mark 1 button press can now be "consumed" when a skill handles
the Stop command.  When this happens, the button press will not
trigger listening mode.  An additional press would be needed to
trigger listening.

This introduces the "mycroft.stop.handled" messagebus message.  It
carries a data field called "by" which identifies who handled it.
Currently the values are "TTS" for when speaking ends or the name
of a skill which implements Stop and returns True from the call.

Also fixed a potential bug when the flag to clear queued visemes
was left set after a button press.
2018-07-05 20:56:54 +02:00
Åke b1408617bc CLI Feature: skill commands (#1612)
* Update format for skill listing

Now send the skills with id and active status

* Add commands to activate/deactivate skills

* Add "unload all except one" functionallity

* Update after rebasing

- fix identifying skills

* Unload skills if they're removed from disk

* Rename _shutdown to default_shutdown

The method is not intended to be non-public, and this should shut up
codacy bot.

* Handle keep command without argument

* Add new commands to help

- Split help into multiple pages as needed

* Support :activate all
2018-06-22 00:59:51 -05:00
Matthew D. Scholefield abd1fe7571
Merge pull request #1637 from forslund/feature/remove-monotonic
Use time.monotonic instead of monotonic module
2018-06-14 14:59:13 -05:00
Åke 3a22eea5ba
Merge pull request #1636 from MycroftAI/feature/upgrade-msm-padatious
Upgrade msm and padatious
2018-06-13 07:44:16 +02:00
Matthew D. Scholefield 85df3adbb0 Remove Padatious version check
No longer necessary now that we notify users when dependencies are out of date
2018-06-12 16:10:26 -05:00
f-e-l-i-x b239d3dc2f German language support (#1634)
* Add parse and format functions for german
* Add german dialog files
2018-06-12 08:55:21 +02:00
Åke Forslund be8711a438 Use time.monotonic instead of monotonic module
Replace the monotonic time from the monotonic module with the built in time.monotonic
2018-06-11 16:05:50 +02:00
Michael Nguyen 0e1307ddf3
Merge pull request #1622 from MycroftAI/bugfix/e.message
Fix missing attribute in error
2018-06-05 16:01:55 -05:00
Åke Forslund dabc92a9b9 Handle unbuilt AdaptIntents
Switched type(intent) == IntentBuilder to isinstance(intent, IntentBuilder) to handle all derived types.
2018-06-02 08:56:15 +02:00
Matthew D. Scholefield dbdd67f965 Add AdaptIntent alias
It is used so that the init argument isn't required and so that it is imported from within the mycroft module
2018-06-01 20:01:25 -05:00
Matthew D. Scholefield 0a3f743b23 Fix missing attribute in error 2018-06-01 16:11:14 -05:00
Åke a0b0e99ffb
Merge pull request #1592 from MycroftAI/bugfix/skills-dir
Remove all references to /opt/mycroft/skills
2018-05-24 07:29:53 +02:00
Matthew D. Scholefield 509162de50 Support tilda in data_dir 2018-05-23 15:03:01 -05:00
jarbasal 0dee4af24c keep message context 2018-05-23 16:08:22 +02:00
Matthew D. Scholefield b0b88bbd62 Remove all references to /opt/mycroft 2018-05-23 08:22:14 +02:00
Matthew D. Scholefield 14ceb1f1dd Remove all references to /opt/mycroft/skills
The only thing that should reference it is the config
2018-05-23 08:22:14 +02:00
Åke 52abe14209
Merge pull request #1601 from MycroftAI/bugfix/retry-less
Make retrying skill installation less frequent
2018-05-22 17:00:39 +02:00
Åke 1f630f6815
Merge pull request #1527 from MycroftAI/feature/improved-skill-tester
Feature/improved skill tester
2018-05-21 16:13:32 +02:00
Matthew D. Scholefield 457ed15b05 Make retrying skill installation less frequent
This prevents things like modifying a default skill from causing skill updates once every 5 minutes
2018-05-17 23:03:50 -05:00
Matthew D. Scholefield 596834dbc8 Retry skill installation every 5 minutes if default skill install fails
This prevents errors with having a spotty internet connection during default skill installation
2018-05-17 17:23:49 -05:00
Matthew D. Scholefield f3ed6065c5 Check for uuid in response
If the meta already exists on the server, it won't have a uuid field in the response
2018-05-15 16:49:03 -05:00
Matthew D. Scholefield b36408dc39 Log exception in skill settings and fix docstrings 2018-05-15 15:58:36 -05:00
Matthew D. Scholefield afe8641159 Stability improvements 2018-05-14 16:41:19 -05:00
Åke ad487cc9fc
Merge pull request #1586 from MycroftAI/feature/configurable-update-interval
Make skill update interval configurable
2018-05-14 22:39:26 +02:00
Matthew D. Scholefield d6f5dd95c5 Make skill update interval configurable 2018-05-14 15:21:36 -05:00
Matthew D. Scholefield 79bf94e48e Speed up intent tests by responding to converse requests 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 154ccd59d7 Expose single threaded training option from Padatious Service
This is necessary to prevent a deadlock when training during intent tests using pytest
2018-05-14 14:27:37 -05:00
Matthew D. Scholefield d1358cc0fc Fix skill reloading when files in subdirectories change 2018-05-11 12:04:30 -05:00
Åke Forslund 0087803d5d Fix trying to make integer from skill-id
skill id's are now the skill path, and can't be made into integers. This issue hinders padatious skills from running.
2018-05-11 10:30:06 -05:00
Matthew D. Scholefield fc8424c9ee Make skill ids use skill folder
This is necessary because in Python 3, hash(x) changes every single start of the application. Using the skill folder makes it consistent. In addition, the skill folder makes it easier to debug parts of the application in comparison to using something like an md5sum
2018-05-10 18:52:17 -05:00
Matthew D. Scholefield 033f5dc010 Add configuration values for msm 2018-05-10 13:11:03 -05:00