Commit Graph

592 Commits (5e8d8eb1a6914244840a99792af4d76a88d6d6a8)

Author SHA1 Message Date
Sergio Oller 5e8d8eb1a6 Feature: Allow comments in voc and regex files
When loading voc and regex files, lines starting with "#" are now
ignored, so developers and translators can use them to document their
decisions.

==== Fixed Issues ====
2018-04-14 21:53:14 +02:00
Åke aa4261252b
Merge pull request #1519 from MycroftAI/feature/stop-sigint
Shutdown improvements
2018-04-12 12:07:02 +02:00
Åke Forslund d61e3c2dd0 Extra safety around skill specific shutdown
Catch error in shutdown method of skill and continue with general shutdown
2018-04-12 11:11:04 +02:00
Matthew D. Scholefield fa11ac7dbe Rename MycroftSkill.shutdown to MycroftSkill._shutdown
This removes the need for skills to call Super(MySkill, self).shutdown()
2018-04-11 21:29:14 -05:00
Matthew D. Scholefield 10bd9a1cf3 Change initial kill to SIGINT
This sends a ctrl+c signal to each process which will allow code to exit properly by handling KeyboardInterrupt
Other notable changes:
 - create_daemon method used to clean up create daemon threads
 - create_echo_function used to reduce code duplication with messagebus
 echo functions
 - wait_for_exit_signal used to wait for ctrl+c (SIGINT)
 - reset_sigint_handler used to ensure SIGINT will raise KeyboardInterrupt
2018-04-11 21:29:10 -05:00
Matthew D. Scholefield 2e005a99e8 Support triggering skill settings update via a message 2018-04-11 15:24:07 -05:00
Matthew D. Scholefield 8cd8eb65b1 Decrease polling to 60 seconds
Now that the server uses ETags, it should be fine with polling every minute
2018-04-11 15:24:07 -05:00
Michael Nguyen 3e2f008c12
Merge pull request #1523 from forslund/bugfix/shutdown-sheduled-events
Fix cancel_all_repeating_events()
2018-04-10 11:15:11 -05:00
Åke 6d339039de
Merge pull request #1524 from forslund/feature/Jarbas-messagebus-intent-control
Add enable/disable intent using the messagebus.
2018-04-06 13:37:24 +02:00
Åke Forslund 58325a83fd Fix cancel_all_repeating_events
Unnamed repeating events caused an exception in
cancel_all_repeating_events, this makes sure the event name is stored
correctly and fixes the issue.
2018-04-06 11:34:36 +02:00
Jarbas 9f1c5e4cbf External enable/disable intent
Allow intents to be enabled or disabled from outside of the skill via
the messagebus.

Adds mycroft.skill.enable_intent and mycroft.skill.disable_intent
2018-04-05 23:29:44 +02:00
Greg Cowan dfa9a65e96 Default skill config to empty dict (#1521)
This defaults skill's configs to an empty dict instead of None,
which simplifies getting specific values in the config for skills.
It removes the check for None config.

==== Fixed Issues ====

====  Documentation Notes ====
Skill writers no longer need to check for None configs.
2018-04-04 23:12:55 -05:00
Åke bc74c36713
Merge pull request #1508 from MycroftAI/feature/notify-backend-down
Add proper messages when the backend replies incorrectly
2018-03-29 12:53:34 -05:00
Matthew D. Scholefield eb100706df Add proper messages when the backend replies incorrectly 2018-03-28 11:48:05 -05:00
Michael Nguyen 2caf77bc9d
Merge pull request #1481 from forslund/feature/repeating-event-safety
Feature/repeating event safety
2018-03-27 19:15:32 -05:00
Åke eac0d81e94
Merge pull request #1502 from JarbasAl/bug_fix_audio_service_old_class_style
AudioService - no old style class
2018-03-23 13:17:04 -05:00
jarbasai 8cf915b83e no old style class 2018-03-23 15:07:21 +00:00
InconsolableCellist 7447dbd5ea Simple log output change to prevent confusion (#1497)
Modified the debugging message output after an utterance is complete, to
make it clear that metric data is only sent if opt_in is enabled.

This addresses #1494, which I filed in error, thinking that opt_in was
never checked (due to reading the log output and not knowing it was
checked elsewhere)

==== Fixed Issues ====

==== Localization Notes ====
Slight change to existing, unlocalized text
2018-03-22 13:18:11 -05:00
Michael Nguyen d6b4037258 remove unused function in skill settings 2018-03-21 14:49:31 -05:00
Åke Forslund 764d200d1b Only allow one repeating even of each type
Previously if duplicates of a skill should be launched or a skill isn't properly
shutdown when reloaded multiple handlers could be registred. This commit disables multiples of repeating events.
2018-03-15 12:39:25 +01:00
Åke Forslund 6dae1bb328 Do not reschedule an active repeating event
- Hinder multiple events with the same name to be registered
- Automatically cancel repeating events when skill is shutdown
2018-03-15 11:42:08 +01:00
Steve Penrod 8ef691ffb7
Slowing the skill setting poll to once every 5 min
Experiment to see if this is overloading the backend.
2018-03-14 03:37:57 -05:00
Michael Nguyen b884378fbb
Merge pull request #1466 from forslund/feature/quieter-skill-fetching-error
Reduce verbosity when skill settings fetch fails.
2018-03-11 12:34:07 -05:00
Åke Forslund 65cba626fd Reduce verbosity when skill settings fetch fails.
Replace the stack trace with a shorter message, briefly printing the cause.
2018-03-11 17:05:52 +01:00
Åke 2c151fe594
Merge pull request #1458 from MycroftAI/refactor/handler-args
Refactor event handler argument calling
2018-03-08 08:29:40 +01:00
Åke Forslund b4ed9369fd Handle exception in skill shutdown
An exception raised during the shutdown would previously cause the skill reload process to halt. This catches any exception and reports the error without halting the SkillManager
2018-03-07 13:23:45 -06:00
Åke Forslund 11bae2aea3 Fix issue in skill shutdown.
If super's shutdown was called before trying to cancel events an exception would be thrown since shutdown removed all registered events by setting self.events to None.

This replaces this with an empty list to allow skills to try to remove events/cancel events without incidents.
2018-03-07 13:23:45 -06:00
Matthew D. Scholefield 0962a3b6af Fix potential crash in add_event 2018-03-07 10:13:20 -06:00
Matthew D. Scholefield 4131730089 Refactor handler argument calling 2018-03-07 10:12:13 -06:00
Åke 2719f96950
Merge pull request #1454 from MycroftAI/bugfix/intent-mixups
Use function attributes for intent decorators
2018-03-01 08:37:45 +01:00
Åke 5a68908e80 Call callback when remote settings are inited (#1452)
When a fresh image first updates the settings after pairing it is handled somewhat differently and this was missed in the original implementation of the callback handling.

This minor change includes this case as well.
2018-03-01 01:07:55 -06:00
Matthew D. Scholefield 881687012e Train Padatious on mycroft.skills.initialized (#1455)
Fix sporadic issues from training prematurely.
2018-02-28 21:55:14 -06:00
Matthew D. Scholefield 07ce2d98d0 Use function attributes for intent decorators
This prevents needing to use a shared list which misbehaves when multiple skills initialize at once
2018-02-28 19:13:33 -06:00
Matthew D. Scholefield cdb1416252 Check for pairing before performing routine polling (#1451)
This gets rid of error messages during the pairing process
2018-02-28 15:41:23 -06:00
Zachary T Welch a7044f9967 only NTP sync on certain enclosures 2018-02-27 18:00:33 -06:00
Åke 743082734c Fix multiple triggering of repeating events (#1435)
If the scheduler was frozen for some time and the repeating event
scheduled time passes it would trigger the event constantly until the
next time is in the future again.

This will make the scheduler to disallow scheduling in the past and
instead schedule the next call one repeat period from now.
2018-02-27 16:37:29 -06:00
Matthew D. Scholefield ce908b6098 Add message when skills are initialized (#1449)
Posts ```mycroft.skills.initialized``` once the initial skill load completes.
2018-02-27 16:22:40 -06:00
Matthew D. Scholefield efc1c1d71e Wait while speaking before running __get_response (#1432)
This fixes issues with long TTS responses
2018-02-23 01:49:06 -06:00
Åke b58a533e39 Bugfix/munging related issues (#1434)
* Fix error message for enable_intent

The error was printed for each intent name mismatch instead of after all intents had been checked.

* Make sure intents aren't munged multiple times

Previously intents could be munged multiple times (This happened when enabling a disabled intent), resulting in an invalid name.

* Add test case for disable/enable intent

* Improve unmunging of messages

This make sure that only skill id's in the beginning of messages are removed and should speed up the process slightly

* Fix munging for register_vocab and register_regex

* Add testcases for register vocab and regex
2018-02-23 00:51:55 -06:00
Matthew D. Scholefield b57165477c Fix self parameter in decorator functions with single argument 2018-02-15 17:33:03 -06:00
Åke Forslund 7970f5bc9d optional start/completed messages for add_event
When creating event handlers with add_event now by default there are no
messages about start and completion of the handler.

The handler info base name is now passed as an argument to the method
allowing for custom messages. skill intent handlers still report
skill.handler.start and skill.handler.complete but for example scheduled
events wont send these start/stop (but could instead trigger for example
        skill.scheduled_event.start/complete)
2018-02-15 15:31:33 -06:00
Åke ea7c7efee1 Fix cancel_scheduled_event for non-repeating events by updateing pyee to v5.0.0 (#1425)
* Update pyee to v5.0.0

The old version of pyee (1.0.1) could not remove events registered as "once" (instead of "on")
This fixes canceling scheduled events

* Restore MycroftSkill.remove_event() return value

The return statement in remove_event() was missing, probably lost while handling a conflict.
2018-02-15 14:52:18 -06:00
Åke b4c6f63352 Validate message before trying to demunge (#1427)
The data field of the message sent to the event handler may not always be a dictionary, (Example case Timer skill, which sets data to the timer name)

This validates the message type and the type of the data field before trying to unmunge.
2018-02-15 14:11:21 -06:00
penrods f54eacbd53 Add default when for schedule_repeating_event()
MycroftSkill.schedule_repeating_event(handler, when, frequency) now
will compute the 'when' as now+frequency seconds if None is passed.
2018-02-15 05:40:38 -06:00
Åke 7fd63f9d5a
Merge pull request #1421 from MycroftAI/feature/doc_cleanup
Internal documentation, typos, remove misleading message
2018-02-15 10:51:33 +01:00
Åke 3271ff3e24
Merge pull request #1420 from MycroftAI/feature/cli_declutter
Reduce CLI log clutter from settings, etc
2018-02-15 10:31:51 +01:00
Åke ed6ab224c9
Merge pull request #1422 from forslund/feature/munge-keywords
Make keywords per skill to fix overlapping keyword names
2018-02-15 09:57:03 +01:00
Steve Penrod 8139727714
Merge branch 'dev' into feature/doc_cleanup 2018-02-15 02:48:10 -06:00
Åke bda8a0cc94 Skip skill update on startup if recent (#1392)
* Skip skill update on startup if recent

Skills aren't updated on startup if the last update was less than 12
hours ago.

- msm adds a .msm file in the skills directory with a timestamp and a
    list of the skills installed by default
- the UPDATING screen message is moved to the SkillManger when direct
    update is scheduled.
- On internet connection the skill update time is scheduled
- Skills (other than priority skills) are not loaded until
- The timeout for when direct update is necessary is settable in the
    config.
internet connection has been verified (message on messagebus)
2018-02-15 02:43:06 -06:00
Steve Penrod 23302b60d9 Add copyright notice and minor docstring changes 2018-02-15 09:29:04 +01:00