Commit Graph

1268 Commits (f95aed1ad373f22f79aeca3bd5843f790d974795)

Author SHA1 Message Date
penrods e1b4ad0400 Fixed silly typo... 2017-10-16 19:20:22 -05:00
penrods 47e2df1722 Prevent the "rolling eye" syndrome
When (re)booting a Mark 1 unit will show rolling eyes until it reaches
a "ready" state.  This happens by sending a command to the Arduino.
There is also code that prevents sending commands our the serial port
if not running on a Mark 1.  In certain situations, the message
indicating that the Mark 1 Arduino was found was posted to the
messagebus before it was fully open.  When this was missed, the system
didn't think it was on a Mark 1 and the command to stop the eyes from
rolling (and for further interactions with the Mark 1 hardware) were
not sent.

The Mark 1 Arduino detection is now triggered when the messagebus
'open' notification is generated rather than when the object is
constructed.

==== Fixed Issues ====
#967 - Eyes never stop spinning on startup (Mark 1)
2017-10-16 19:20:22 -05:00
Michael Nguyen b82d11e5a4 Merge pull request #1159 from MycroftAI/bugfix/listener-reload
Add timeout to consumer queue get
2017-10-16 18:04:16 -05:00
Åke Forslund 84e47fb25f Fix reloading skills system
==== Fixed Issues ====
One exemple is reloading pairing skill after skill update (30-60 seconds)
results in a new pairing code being generated.

====  Tech Notes ====
Now compare individual skill modification dates and not a global last
modified skill.
2017-10-16 17:54:03 -05:00
Matthew D. Scholefield b53e0bb202 Add timeout to consumer queue get
Prevents hanging on config reload
2017-10-16 16:05:01 -05:00
penrods 8c696b0586 Issue #967 - eyes keep spinning on boot
This fixes at least a potential issue with the Mark 1 boot sequence.
The system posts a "system.version" message then registers a
listener for the response.  There is a chance that the response
sneaks in before the handler is registered.  This just reorders the
sequence of that code.

==== Fixed Issues ====
ISSUE #967 - Eyes never stop spinning on startup (Mark 1)
2017-10-15 12:27:55 -05:00
Åke Forslund 131b10e0fc wait for msm lock to be free before loading skills
====  Tech Notes ====
The msm lock wasn't checked before reloading skills allowing skills to be loaded before msm wasn't finished installing requirements.

A check was added to ensure this along with a separate lock enforcing the handling of block_msm and release_msm in the correct order. If not the update procedure could cause a deadlock.
2017-10-15 11:30:57 -05:00
Åke Forslund f70588cab7 Add message parameter to methods connected to ws 2017-10-15 11:30:57 -05:00
Michael Nguyen f6ee33a90e formatting fixes 2017-10-13 18:09:20 -05:00
Michael Nguyen f68be2a72c added safety net for null values in get settings 2017-10-13 18:09:20 -05:00
Åke 3e8b366642 Merge pull request #1151 from MycroftAI/feature/skill-settings
improved skill settings
2017-10-13 23:16:00 +02:00
Michael Nguyen 2623cb8cca added is_alive 2017-10-13 16:06:07 -05:00
Michael Nguyen 157c113678 fixed timer bug 2017-10-13 13:43:55 -05:00
Åke Forslund b40e03d859 Fix update interval after success
The interval was previously not updated after success (unless speak was set to
true). This caused the skills to continuously update.

Also set speak = false as default since that's the most commonly used
case right now.
2017-10-13 15:53:10 +02:00
Åke Forslund 7c0a3b2fe5 Fix codacy warnings. 2017-10-13 11:22:01 +02:00
penrods 3d64509b25 SkillManager, msm messagebus notifications
Significantly reworked the loading/updating of Skills.  Unified
all management under a single SkillManager class.  This class
runs as a thread that initially loads, upgrades (via MSM)
and reloads skills.

Removed the independent threads that were being run.  The skill
updating still happens once an hour, but works in conjunction
with the scan to reload modified skills.  Also added messagebus
notifications from MSM so mycroft-core can pause reloading
skills until the installation is complete.

Added a new mycroft.messagebus.send module to allow command
line interaction with the messagebus, e.g.:
   python -m mycroft.messagebus.send mycroft.wifi.start
   python -m mycroft.messagebus.send speak '{"utterance":"hello"}'

==== Fixed Issues ====
MSM installs that have PIP dependencies were failing, as the
load would occur after code was retrieved but before PIP install
completed.  Restart was required to load new skills.

====  Tech Notes ====
TODO: Change the way we manage modules.  The auto-load of the
remote configuration for the module is silly, slow and wasteful.

I made the WebsocketClient.build_url() method static in
anticipation of being able to do this more efficiently when the
submodule load doesn't hit the remove API automatically.

==== Localization Notes ====
Modified 'sorry I couldn't install default skills' message.

==== Protocol Notes ====
MSM now generates:
  msm.updating
  msm.installing
  msm.install.succeeded     { "skill" : name }
  msm.install.failed        { "skill" : name, "error" : code }
  msm.installed
  msm.updated
  msm.removing
  msm.remove.succeeded      { "skill" : name }
  msm.remove.failed { "skill" : name, "error" : code }
  msm.removed

An update can now be forced by posting 'skillmanager.update' to the
messagebus.
2017-10-13 02:21:58 -05:00
Michael Nguyen 614cc57d01 made some changes 2017-10-12 14:36:23 -05:00
Michael Nguyen cec098c442 update docstring 2017-10-12 13:32:50 -05:00
Michael Nguyen f3dacfb204 ==== Tech Notes ====
added capability to auto upload changes from settingsmeta.json to home.mycroft.ai

====  Documentation Notes ====
If a developer make changes to the settingsmeta.json, then this will be auto uploaded to home.mycroft.ai

==== Protocol Notes ====
hash and uuid are now stored as variables in files located in ~/.mycroft/skills/{skill-name}
2017-10-12 12:35:50 -05:00
Augusto Monteiro 'Sparky beaea7557b Fixing random extra space 2017-10-11 14:36:12 -05:00
Augusto Monteiro 'Sparky e39c38ff3c Updating version when device is update 2017-10-11 14:36:12 -05:00
Åke Forslund a5b96ba285 Correct stop_speaking() to handle threaded tts OK
====  Tech Notes ====
Now the stop_speaking() method sends a signal to the speech module to
stop speech instead of killing all aplay/paplay instances
2017-10-10 14:02:18 -05:00
Åke Forslund 0daee0eb53 Fix bug in stop_speaking()
====  Tech Notes ====
stop_speaking would not run properly due to two missing imports
2017-10-10 14:02:18 -05:00
Åke a006a3d5b6 Merge pull request #1120 from MycroftAI/feature/fix-log-autocomplete
Fix log autocomplete

==== Tech Notes ====
Due to the use of setattr(), IDEs like PyCharm couldn't use autocomplete on the LOG class. This unrolls the loop so that the logging attributes appear in the autocomplete menu.
2017-10-07 13:06:15 +02:00
Matthew D. Scholefield ef1a6e24c3 Upgrade padatious to fix travis build 2017-10-06 00:06:08 -05:00
Michael Nguyen 33277fef34 Merge pull request #1132 from MycroftAI/bugfix/padatious-load-vs-add
Padatious fixes
2017-10-05 16:34:45 -05:00
Arron Atchison 896470c18f Update __init__.py 2017-10-05 20:38:39 +09:00
Arron Atchison 2a8aeeb459 version bump to 9.0.0 2017-10-05 20:36:09 +09:00
Åke Forslund ad0e9870c2 Add notifications when starting/stopping recording
====  Tech Notes ====
Add text notifying start and stop of recording
2017-10-04 21:56:02 -05:00
Matthew D. Scholefield b6bc4ee482 Increment padatious version number to 0.3.3
This adds a bugfix for empty containers
2017-10-04 21:50:54 -05:00
Matthew D. Scholefield 43a59b0d88 Fix Padatious to load intents and entities
Doesn't make sense to add intents since no sample lines are provided
2017-10-04 21:45:21 -05:00
Åke 6acc0adb40 Merge pull request #1128 from MycroftAI/feature/to-apache-license
Change to Apache 2.0 license from GPLv3.0
2017-10-04 09:13:40 +02:00
penrods d49ec3616f Fixing PEP8 whitespace errors 2017-10-04 01:44:58 -05:00
penrods 8f2e5d9498 Change to Apache 2.0 license from GPLv3.0
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0.  All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.

Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors.  This cleanly
protects the project, the contributor and all who use the technology
to build upon.

Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/

This commit also removes all __author__="" from the code.  These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear.  Do you remove a name from the list if the
last line of code the wrote gets replaced?  Etc.  Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!

Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."

==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md

====  Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().
2017-10-04 01:28:44 -05:00
Åke b850143824 Merge pull request #1117 from forslund/bugfix/inspect-failure
Add workaround for inspect-decorator problem
2017-10-04 07:08:15 +02:00
Matthew D. Scholefield 32ac6a83da Fix Padatious parameter 2017-10-03 19:31:37 -05:00
Augusto Monteiro 7252f5e7dd Merge pull request #1127 from MycroftAI/feature/detect-opt-in
Use opt in value to record wake words
2017-10-03 13:33:40 -05:00
Matthew D. Scholefield 0569ba40f7 Use opt in value to record wake words 2017-10-03 13:24:09 -05:00
Matthew D. Scholefield 403aeb9360 Upgrade Padatious to 0.3.2 which brings in entity support 2017-10-03 12:17:02 -05:00
Åke dfaed4f610 Merge pull request #1119 from MycroftAI/bugfix/fix-save
Fix configuration manager saving

==== Tech Notes ====
Fixes ConfigurationManager.save() method. Previously incorrect use of dict update method resulted in empty config. Now the saved dict is recursively merged to only update affected fields.
2017-09-29 09:45:36 +02:00
Matthew D. Scholefield 9483d0a50e Unroll loop to explicitly show attributes in LOG
This allows IDEs to use autocomplete on the LOG class
2017-09-29 02:01:22 -05:00
Matthew D. Scholefield da448c4bdd Change update to merge_conf
This prevents replacing sub-dicts rather than recursively merging
2017-09-29 01:39:16 -05:00
Matthew D. Scholefield a6709033d4 Remove wifi setup 2017-09-29 15:12:47 +09:00
Matthew D. Scholefield 4c1a0d471b Fix configuration manager saving 2017-09-28 22:29:17 -05:00
Patrick Freeman 4f4547182b issue-1091 - Provide Dutch translations of dialog files 2017-09-28 11:28:45 -05:00
Åke Forslund 605f0640ec Make sure structure for wake word exist before use
==== Fixed Issues ====
#1105

====  Tech Notes ====
Verify that the sub-config for the set wake word exist before writing to
it.
2017-09-28 11:22:41 -05:00
Jarbas f5806b86c5 fallback start, end, failure messages (#1108)
==== Tech Notes ====
Add mycroft.skill.handler.start and mycroft.skill.handler.complete to fallback handler. handler in data field will be called "fallback" upon completion the used handler will be reported in the "fallback_handler" data entry.

* fix

* pep8

* fallback handler name
2017-09-28 17:53:57 +02:00
Åke Forslund 838e2dd7d8 Remove repeating events from saved schedule
====  Tech Notes ====
Repeating events are not saved to make sure repeating events aren't
stacked over and over.
2017-09-28 02:24:34 -05:00
Åke Forslund 5d9574ea4f Reorder canceling and adding event handling
====  Tech Notes ====
If cancel + add event messages arrive at roughly the same time the add
would be overridden by the cancel. More intuitive to handle cancel first
and add new arrived events after.
2017-09-28 02:24:34 -05:00
Åke Forslund 1d0e65dfb1 Fix update_event and cancel_event methods
====  Tech Notes ====
update_event and cancel_event did not use a name unique to the skill
forcing the user to build it themselves. Now the unique name is
constructed in the method _unique_name() for all event scheduling
methods.
2017-09-28 02:24:34 -05:00
Åke Forslund 68a96b40b0 Add workaround for inspect-decorator problem
====  Tech Notes ====
when using multiple decorators on a method inspect will return incorrect
values despite @wraps. This causes the intent handler to fail to
execute.

@decorator can't really be of help here since it doesn't handle
decorators with arguments (as far as I can understand)

This is a workaround using the fact that the argument count will be zero
on methods with multiple decorators, and basically tries the usual
signatures
2017-09-26 19:11:33 +02:00
Åke b13113d76e Merge pull request #1095 from MycroftAI/feature/logger
Add new LOG class
2017-09-21 16:55:44 +02:00
Matthew D. Scholefield e7474ccc29 Fix tornado autoreload error 2017-09-21 09:37:08 -05:00
Matthew D. Scholefield 07e94f2d07 Improve LOG code and add log unit test
Adjusts style for readability and generates methods dynamically
2017-09-20 12:45:22 -05:00
Arron Atchison 85081c00f3 Version bump to 0.8.22 2017-09-19 11:15:20 +09:00
Matthew D. Scholefield 5e392f34aa Optimize imports
Remove unused imports and group local vs external alphabetically
2017-09-18 16:07:50 -05:00
Matthew D. Scholefield cfdc405da5 Add new LOG class 2017-09-18 13:56:06 -05:00
Åke Forslund 23444c65ee Replace Intent invocation with specific messages
==== Protocol Notes ====
New messages on the message bus:
- mycroft.volume.increase
- mycroft.volume.decrease
2017-09-15 12:14:35 -05:00
Åke Forslund f756673bff Start network check faster
====  Tech Notes ====
The network check is now only delayed until priority skills have been
loaded (this includes the relevant pairing skill)
2017-09-15 06:48:39 -05:00
Åke Forslund a100d2a6dc Refactor priority skill loading
====  Tech Notes ====
- Set pairing as a priority skill by default
- Move priority loading to separate function
2017-09-15 06:48:39 -05:00
Jarbas 82b49c1397 Jarbas work adding priority skill loading 2017-09-15 06:48:39 -05:00
Åke Forslund 1b50c02d0d Fix missing "I am awake" at wake up
====  Tech Notes ====
Mycroft did not acknowledge that he was woken due to missing forwarder
of speak commands to message bus.
2017-09-15 06:42:45 -05:00
Åke Forslund bec91c2c30 Disable wake word upload by default
====  Tech Notes ====
Change default config to disable wakeword upload.
2017-09-15 06:30:04 -05:00
Åke Forslund 03a5c5eae5 Remove extra phoneme set
====  Tech Notes ====
In addition to the normal hot word there was an extra set of "global
phonemes"
2017-09-15 06:29:25 -05:00
Åke Forslund 444a09587e Fix hotword override
==== Tech Notes ====
The threshold of the hotword was overritten with None since no default
threshold is in the default configuration
2017-09-15 06:29:25 -05:00
00tiagopolicarpo00 2a17cf246c Update ssh enabled.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 81def1107f Update ssh disabled.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 148cc9e96c Update sorry I couldn't install default skills.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 dccb9956aa Update skills updated.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 4a2f453360 Update reset to factory defaults.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 9b60f3a35a Update not connected to the internet.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 16c1729904 Update no network connection.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 ff1c4e3f18 Update i didn't catch that.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 cf86798b02 Update i am awake.dialog 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 854dfe3300 Add portuguese translation to the dialogs 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 5ae6e0e345 Add files via upload
Add portuguese translation to the dialogs
2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 adc884e381 Delete index.txt 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 4d4d1f3329 Create index.txt 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 f30667524c Delete pt-pt 2017-09-15 00:07:00 -05:00
00tiagopolicarpo00 101e841554 Create pt-pt 2017-09-15 00:07:00 -05:00
Åke Forslund c8d86ff98d Add check_version method to mycroft.version
==== Fixed Issues ====
NONE - replace with associated issue numbers, e.g. #123, #304

====  Tech Notes ====
Adds a function to check if the core version is newer than a given
version string.
2017-09-15 00:04:24 -05:00
Matthew D. Scholefield af8826a1c7 Learning option for sharing wake word recordings (#1039)
* Add automatic uploading of wake words and learning option in enclosure client

* Spawn new thread and remove ping
Spawning a new thread eliminates the need to ping and eliminates additional latency. In addition, the return code of scp is now used to determine whether to delete the wake word

* Increment enclosure version number
2017-09-14 23:58:32 -05:00
Jarbas e39d013282 Hotword factory (#1062)
* Create hotword_factory.py

* hotword factory

* hotword factory

* hotword factory

* pass language

* HotwordEngine base class

* standup_word config

* missing ,

* hotword factory

* missing ,

* HotWordEngine template

* hotword factory

* pep8

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* hotword factory

* fix unittest

* fix conflicts

* recognizer dir fix

* fix path

* fix path

* correct path

* fix path for realz

* fix path for real realz

* path fixed, end of brain fart

* fix phoneme lenght

* compatibility

* num phonemes for non pocketsphinx modules

* pep8

* bug fix

* bug hunt
2017-09-14 23:34:16 -05:00
Steve Penrod db72dde378 Fix another Codacy warning 2017-09-14 16:51:16 -05:00
Steve Penrod a268b2e0ee Fix Codacy warnings
Fixes a few minor things triggering Codacy warnings.
2017-09-14 16:51:16 -05:00
Steve Penrod 92b8b59cde CLI: Add find command and chat history sizing
This extends the Command Line Interpreter with two new features:
* Add command
    :find 'string'
  Only show log lines that match the given string, including
  newly incoming log lines.  Hit Ctrl+X to end the search.
  Ctrl+F works as a shortcut.
* Add command
    :history #
  Change the change history height to # lines.  This setting
  stays across sessions.
2017-09-14 16:51:16 -05:00
Åke Forslund 326939df35 Make muted mic stay muted when stt is restarted
====  Tech Notes ====
- Number of callers is now handled in the recognizer loop to make sure
status isn't lost when new settings is applied.
- Adds a force_unmute method to make sure the device is completely
unmuted when the user presses the top button.
2017-09-14 16:50:43 -05:00
Åke Forslund cf9aafa765 Add data to the information of running skill
==== Tech Notes ====
The handler name (including class if available) is sent along in the
data field. If an exception is raised an exception field in the data is
added with minor information of the problem.
2017-09-14 16:38:54 -05:00
Åke Forslund 1d6da7d37d Add messages for skill handler's starting/stopping
====  Tech Notes ====
Add message bus messages when a skill handler is starting to execute and
a separate message for when skill handler completes. Usable if grouping
speech in certain clients for example. Can also be of use for audio
ducking and similar processes.

==== Protocol Notes ====
Adds the following messages:
mycroft.skill.handler.start
mycroft.skill.handler.complete
2017-09-14 16:38:54 -05:00
Åke Forslund 1e74dd3ebe Restore reconnect timer on ws on connect
====  Tech Notes ====
The retry timer doubles on each failed connect attempt but was never
restored to the original time causing an unncessary long wait time. This
restores the timer on each sucessful connection.
2017-09-14 14:22:06 -05:00
Åke Forslund cc3a33aa77 Remove debug prints 2017-09-14 14:29:40 +02:00
Åke Forslund 0d4a841d4e Make test_api slightly more robust 2017-09-14 11:01:32 +02:00
Åke Forslund d750935fe3 Allow any bitrate of audio to the MycroftSTT
====  Tech Notes ====
Setting the convert_rate enforces the output bitrate of the FLAC audio.

This requires update of speechrecognition (3.7.1) and PyAudio (0.2.11)

==== Environment Notes ====
PyAudio => 0.2.11
speechrecognition => 3.7.1
2017-09-13 14:31:36 -05:00
Åke Forslund a33c07621b Reduce configuration loading in module scope
====  Tech Notes ====
Autoloading configuration in submodules is bad for testing purposes and
should be reduced. It takes time and adds the possibility of altering
the base conditions for the tests

- mycroft/skills/core: global configuration moved to main.py
- mycroft/messagebus/client/ws.py global config moved to __init__ of
Websocket
- client/speech/mic.py global config moved to ResponsiveRecognizer
__init__() method
- client/enclosure/display_manager.py
 - get_ipc_directory() called in methods where used
2017-09-13 12:51:48 -05:00
Åke Forslund 14f931e046 Fix send pairing utterance before loading skills
====  Tech Notes ====
Add a wait until skills have been loaded once before checking for
internet connection. If not an "I'm sorry I didn't catch that" may be
emitted since the pairing skill isn't loaded.
2017-09-13 12:49:31 -05:00
Åke Forslund 31701fc05d Add more safety around the context manager
====  Tech Notes ====
- Sanity check Message in handle_add_context(), 'word' needs to be a
string before calling into the context manager.
- Sanity check Message in handle_remove_context(), make sure a context
keyword was received before trying to remove.
- Docstrings
- Suppress exceptions while injecting context
2017-09-13 12:44:35 -05:00
Åke Forslund 64baa7d420 Enclosure mutes the mic and should unmute it
====  Tech Notes ====
Listens for 'mycroft.paired' and will unmute the mic when this occurs.
This was handled by the pairing skill but for clarity it should be
unmuted at the same place.
2017-09-13 12:02:27 -05:00
Åke Forslund e9f8d85040 Make mic mute counting instead of boolean
====  Tech Notes ====
Mute was previously a simple boolean meaning that if two parts of the
code wanted to mute it it would unmute the mic as soon as the first of
the two pieces of code wanted to unmute.

For example tts output will mute the mic and unmute it when the audio
output is complete. During first start up of a mark-1 the enclosure
mutes the mic and expects it to be muted until the pairing is complete.
This doesn't work. The mic get's unmuted as soon as the first sentence
has been spoken.

This counts the number of times mute is called and will not unmute until
as many unmute calls has been made.
2017-09-13 12:02:27 -05:00
Åke Forslund 65fa735a3a Fix isSpeaking
====  Tech Notes  ====
isSpeaking was lowered as soon a the tts had synthesized the audio and
not when the output finished. This commit moves the signal
raising/lowering to the tts instead of the 'mycroft.speak' handler.
2017-09-13 12:02:27 -05:00
esoleyman c8c5afdeaf Change instance of ConfigurationManager().get to ConfigurationManager.get 2017-09-13 10:41:02 -05:00
Åke Forslund 5ddf1250ab Fix issues discovered by codacity. 2017-09-12 15:07:20 -05:00
Åke Forslund df8fe650c8 Update docstrings after PR feedback 2017-09-12 15:07:20 -05:00
Åke Forslund f1c6912d43 Add event scheduler
====  Tech Notes ====
A single thread handling scheduled events. The skills interact with this
using the self.schedule_event() self.schedule_repeating_event
self.update_event() and self.remove_event().

This is an improvement over scheduledSkill since each skill creates
their own Thread and has to handle storing/restoring scheduled events
between starts.

All pending events are stored in a json file at shutdown for future
sessions.

====  Documentation Notes ====
Needs to be documented

==== Protocol Notes ====
new messagebus event handlers:
- mycroft.scheduler.schedule_event
- mycroft.scheduler.remove_event
- mycroft.scheduler.update_event
2017-09-12 15:07:20 -05:00
Åke Forslund 72a318cd92 make skill id hash of skill directory
====  Tech Notes ====
To ensure that the skills have the same id when loading the id was
replaced with a hash of the skill directory. (as long the skill isn't
 renamed). This is useful for things like the event_scheduler where
skills are referenced using the skill id and has info being persistent
over restarts
2017-09-11 19:43:02 -05:00
Michael Nguyen eb6340265b Merge pull request #1060 from forslund/feature/ignore-enclosure-mouth-update-messages
Ignore enclosure.mouth.display message by default
2017-09-08 10:38:40 -05:00
Åke Forslund 0c8aaa2664 Ignore enclosure.mouth.display message by default
====  Tech Notes ====
Add 'enclosure.mouth.display' to ignore_logs default configuration since
it will get called alot and spam the skills log.
2017-09-07 15:59:34 +02:00
Matthew D. Scholefield 9efcc01ce0 Update padatious 2017-09-06 19:22:33 -05:00
Brian Hopkins c2aa2ebb97 fixing typo (#1052)
* fixing typo

fixing color function
2017-09-04 00:49:08 +02:00
Åke 27dba0c786 Merge branch 'dev' into make_message_optional 2017-09-01 21:29:16 +02:00
jarbasai b6e89f02b0 pep8 2017-09-01 12:28:37 -05:00
Jarbas c05590bc7c save utterances 2017-09-01 12:28:37 -05:00
Åke Forslund c7c25cc01b Fix errors during shutdown
====  Tech Notes ====
Skills weren't cleanly shutdown. This ensures that skills are shutdown more cleanly and that shutdown procedure will not be interrupted by broken shutdown methods.

Shutdown of reload thread fixed

Unused globals removed
2017-09-01 10:53:22 -05:00
Åke Forslund 2881b1842f Setting storage is no longer forced at shutdown
Risk of corruption if the skill service was terminated while settings
were written was determined to be greater than any benefit from this.
2017-09-01 10:45:05 -05:00
Åke Forslund 0782064819 Write settings dict to disk more frequently
====  Tech Notes ====
After an intent has been handled the settings will be stored if any changes are detected.

A force option was added to the .store method of the settings class which always writes the dict to disk even if no changes has been made. This is used during shutdown.
2017-09-01 10:45:05 -05:00
Michael Nguyen 995d67e612 Merge pull request #1018 from forslund/bugfix/issue-1014
Bugfix/issue 1014
2017-08-31 15:59:32 -05:00
Michael Nguyen 2dc6e47bea Merge pull request #1020 from forslund/bugfix/issue-1019
Fix expect response for speak_dialog
2017-08-31 15:58:54 -05:00
Michael Nguyen e7775d26d0 Merge pull request #1026 from forslund/bugfix/issue-1022
Fix failure when using one_of in intents
2017-08-31 15:58:38 -05:00
Michael Nguyen 2dab08f483 Merge pull request #1035 from forslund/bugfix/localization
Bugfix/localization
2017-08-31 15:58:02 -05:00
Åke Forslund 144e9c016c Automatically find skill directory in __init__
====  Tech Notes ====
Previously the _dir parameter was poplated from the skill loader between calling __init__() and initialize(). The skill path can however be gleaned from with in the __init__() of MycroftSkill.

Doing this makes the settings accessable from __init__() as well and will allow a more straight forward usage.
2017-08-31 15:54:46 -05:00
Åke Forslund d746a87e34 Added docstring for update_context
Including note about not working on one_of keywords.
2017-08-31 21:34:30 +02:00
Åke 14254893cf Merge pull request #1023 from MatthewScholefield/feature/module-imports
====  Tech Notes ==== 
Adds the most commonly used methods and classes in more convenient location

Changing from mycroft.skills.core import MycroftSkill to simply from mycroft import MycroftSkill

====  Documentation Notes ==== 
The skill tutorial should be updated to use these shorter import paths.
2017-08-31 14:13:00 +02:00
Steve Penrod ae2583662f Correcting CLI handling of main() for issue #1036
The idiom for handling main() was incorrect to allow the CLI
to be invoked by the mycroft-cli-clent script.

==== Fixed Issues ====
2017-08-30 22:45:16 -05:00
Steve Penrod f9702157a6 Minor CLI fixes and enhancements
Several changes to CLI behavior, all minor:
* Inverted the behavior or PgUp/PgDn.  I think it was just wrong
* Added "oldest" and "newest" indicators to the log listing to
  simplify finding your way inside the logs
* Added support for _not_ scrolling when in the middle of the log
  output.  It will now only auto-scroll when already at the front
  of the log so you keep seeing new messages automatically.
* Added a heading for the mic output level
* Limited the mic output level to just the size of the bottom
  area (previously it was proportional to the screen height)
* FIX: Changed the default filter string for viseme
* FIX: The saving of settings was broken
* Ran autopep8 which added a few bits of whitespace here and there
2017-08-30 22:45:16 -05:00
Åke Forslund 9a6d282435 Warn when pocket sphinx model file is missing
====  Tech Notes ====
When a pocket sphinx model is missing an error is logged and the default
(us english) model is tried.
2017-08-31 00:19:00 +02:00
Åke Forslund de8dff6320 defaulting to TimeRulesEnUs now works
====  Tech Notes ====
Wheb a language without time rules were defaulted back to us-english
time rules the class was instanciated prematurely. Now the default
returns a class and not an object.
2017-08-31 00:18:43 +02:00
Åke Forslund ab44f24c22 Use io.open instead of open to load utf-8 dialog
==== Fixed Issues ====
#1027

====  Tech Notes ====
io.open is the default implementation of open for python3 and handles
encodings in a better way defaulting to utf8
2017-08-31 00:18:25 +02:00
Matthew D. Scholefield 789b452e5e Add useful imports to mycroft and mycroft.util modules 2017-08-29 11:09:12 -05:00
Åke Forslund 7022239456 Fix failure when using one_of in intents
==== Fixed Issues ====
#1022

====  Tech Notes ====
When a one_of intent is hit the intent returned by adapt doesn't look like normal require/optional intent parameters. This PR adds a check for entities before trying to accessing them when trying to update context.

This is a temporary workaround while it's determined if the adapt behaviour is correct or should be modified to conform to the normal format. (See issue 66 in the adapt repo), but in any case it's a good sanity check
2017-08-29 09:05:29 +02:00
Åke Forslund b44b2914af Fix expect response for speak_dialog
==== Fixed Issues ====
the expect_response pararmeter is now correctly passed along to
self.speak()

====  Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-25 14:26:33 +02:00
Åke Forslund 34a527b130 Add warning if skill isn't properly removed 2017-08-25 11:15:50 +02:00
Åke Forslund 3be861cee2 Fix trailing references causing memory leak
==== Fixed Issues ====

====  Tech Notes ====
This PR corrects a couple of small issues led to skills being left in memory when.
- Handler for `stop.mycroft` weren't removed from event emitter when
skill shut down. Now is added using `self.add_event()`
- registered intent list `self.events` created a circular reference that
python couldn't resolve a live so this is now deleted at shutdown
- Timers in scheduled skills weren't terminated properly. Now if the
timer is alive it will be joined

====  Documentation Notes ====
Registring event handlers should use `self.add_event` instead of
`self.emitter.on()` To make sure they are cleaned up when skill is
terminated.

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-25 11:15:50 +02:00
ginanjar azie 41c7921bbb make message parameter on intent handler optional 2017-08-24 11:15:25 +07:00
leonard-pradier 2e479dd453 Add french translation to the dialogs 2017-08-23 15:17:00 -05:00
Augusto Monteiro 53648b8433 Merge pull request #1012 from forslund/refactor/cleanup-skills
Cleanup skills
2017-08-22 15:03:55 -04:00
Jarbas 684c08d4c0 Allow internal configuration changes PR #980
====  Tech Notes ====
Allow cached config to be updated from messagebus, from a skill or other connected software. Listens for configuration.patch signal and updates loaded config.

==== Protocol Notes ====
new messagebus signal configuration.patch
2017-08-22 14:50:31 +02:00
Åke Forslund dea591e9b8 Cleanup imports 2017-08-22 08:45:06 +02:00
Åke Forslund e61b516ea1 Add more docstrings 2017-08-22 07:40:28 +02:00
Åke Forslund 12bf78cd5f Move funcs only used in skill_tester from core.py
====  Tech Notes ====
Some functions have been orphaned in core.py and are only used in the
tests. To clean up these have been moved to where they're used.
2017-08-21 15:59:48 +02:00
Åke Forslund bb0fbb51ed Cleanup skill service main
====  Tech Notes ====
Minor cleanup and comments
2017-08-21 15:59:48 +02:00
Åke Forslund ebcbbd3a60 Fix skill container
==== Fixed Issues ====
#1007

====  Tech Notes ====
The converse system changed the api for the load_skill() function this
since the skill_container wasn't updated accordingly it stopped working.
This PR makes updates the container to use the new interface.
2017-08-21 15:09:51 +02:00
Jarbas f04f5107e7 small fix (#1005) Rebase issues with converse method
====  Tech Notes  ====
- Use skill id instead of name
- use time() function correctly
2017-08-21 09:18:01 +02:00
Åke Forslund eb4991ade9 Fix multiple reloads of skills at startup
==== Fixed Issues ====
#1001

====  Tech Notes ====
Previously the skills were reloaded a couple of times during startup
since updates of the .pyc file and possible the settings.json file were
made.

This commit adds a bit finer control over which files to check.
Currently all files in skill root except ones ending in .pyc and the
settings.json are checked along with all visible subdirectories
2017-08-18 11:41:14 +02:00
Michael Nguyen f2f5925b09 fixing issue 998 2017-08-17 22:05:49 -05:00
Matthew D. Scholefield 9de5a13659 Add decorator support for intent files and fix regular decorator 2017-08-17 16:01:11 -05:00
Matthew D. Scholefield 7b28e7e61d Make PadatiousService inherit from FallbackSkill to fix new fallback changes 2017-08-17 16:01:11 -05:00
Matthew D. Scholefield e3da4dbcb8 Train on initialization in case no intents are added 2017-08-17 16:01:11 -05:00
Matthew D. Scholefield 3aa52273f4 Add notification when padatious not installed 2017-08-17 16:01:11 -05:00
Matthew D. Scholefield 69d17a373b Create PadatiousService and add padatious to requirements.txt 2017-08-17 16:01:11 -05:00
Jarbas d661b8d2e7 Add conversational support to skill system
The most recently used skills now have an opportunity to preview all
utterances before they hit the intent system.

==== Tech Notes ====
Skills get a preview in the order of activation -- most recent first --
and if they can consume the utterance or ignore it. If consumed,
processing stops. If ignored, the next most recent skill gets a shot
at it. Finally, if no skill consumes it the intent system takes over,
running as it always has.

Skills remain "active" for 5 minutes after last use.

A skill achieves this by implementing the converse() method, e.g.

def def converse(self, utterances, lang="en-us"):
    if .... :
        return True  # handled, consume utterance
    else:
        return False  # not for this skill, pass it along
2017-08-17 12:09:17 -05:00
Åke Forslund 811cbdb6da Remove requrement to build Intents
====  Tech Notes ====
IntentBuilder objects always need to be built into an Intent to be
usable in mycroft. Since this is always neccessary the code doing this
can be moved so users don't need to do this step.

This commit makes the `register_intent()` method check the handler
argument type, if it's an IntentBuilder object it builds the Intent, if
it's an Intent it continues as normal, if it's any other type it will
raise a ValueError
2017-08-17 11:49:00 +02:00
harika 4c3dd3aa7c Updating skill_tester to automate skills testing(regression) 2017-08-17 02:05:02 -05:00
harika 632df2a498 Update tests 2017-08-17 02:05:02 -05:00
Augusto Monteiro 873b231a54 Merge pull request #990 from forslund/feature/downloader
Add class for handling downloads
2017-08-16 12:54:18 -04:00
Åke Forslund f19ac28a5c Add some safety to the add/remove context methods
====  Tech Notes ====
Invalid context or word arguments will now raise ValueError
2017-08-15 21:27:19 -05:00
Åke Forslund b1082d4b27 Only use latest meaning of each keyword 2017-08-15 21:27:19 -05:00
Åke Forslund 242770aa94 Update context config options
- options grouped under "context"
- added option to activate "greedy" context gathering
2017-08-15 21:27:19 -05:00
Åke Forslund d7cbe3065a Add decorators making context management easier 2017-08-15 21:27:19 -05:00
Åke Forslund c9b19cb97e Fix remove_context
Also remove debug prints
2017-08-15 21:27:19 -05:00
Åke Forslund 471a8d8360 Add configuration settings for using adapt's context 2017-08-15 21:27:19 -05:00
Åke Forslund b9a054e669 Manual context injection
A skill can inject context to enable and disable intent handlers
automatically depending on previous conversation.
2017-08-15 21:27:19 -05:00
Åke Forslund 025a771fe1 Add class for handling downloads
====  Tech Notes ====
Downloader() is a Thread subclass starting and handling a download. The
property done and status is set when the download is completed or
failed.
download manager ensuring continuation of started downloads (per process)
complete_action, a function to be called after download is complete can be
supplied to the downloader
2017-08-15 14:42:32 +02:00
Åke Forslund e40ad7e4dc Add subscription endpoint to DeviceApi
====  Tech Notes ====
The DeviceApi now has a `get_subscription()` method returning the entire
subscription structure and the property `is_subscriber` returning True
if the device is connected to a paying account and False if it's a free
account.
2017-08-15 09:03:30 +02:00
Åke Forslund 44b68e3f3f Add handlers for lowering/restoring pulseaudio vol
====  Tech Notes ====
pulse_lower_volume() scans through the list of running input sinks and
reduces the volume to 30% of original volume skipping over the stream
named 'mycroft-voice'

pulse_restore_volume() restores the volume again.

If activated with the 'pulseaudio' config parameter they will be called
when mycroft starts/stops listening and starts/stops speaking

==== Environment Notes ====
The Audio->pulseaudio configuration parameter can now be set to 'lower'
to activate this feature
2017-08-11 16:44:24 +02:00
Augusto Monteiro bbde78cee8 Merge pull request #976 from forslund/feature/easier-fallback
Feature/easier fallback
2017-08-10 15:25:14 -04:00
Augusto Monteiro 540adbd195 Merge pull request #959 from forslund/bugfix/issue-958
Make visime stream end together with audio
2017-08-09 13:57:35 -04:00
Augusto Monteiro f2e9d6b2cf Merge pull request #971 from reginaneon/patch-1
Fixing wakeword save
2017-08-09 13:53:58 -04:00
Augusto Monteiro 2b171b4d34 Merge pull request #970 from forslund/bugfix/issue-969
Fix message bus logging for audio service
2017-08-09 13:42:10 -04:00
Åke Forslund dc8b01f61f Fix mute mycroft-voice
====  Fixed Issues ====
#978

====  Tech Notes ====
We name the stream insted of the client. Now mycroft-voice is excluded
from mute.
2017-08-09 17:28:42 +02:00
Åke Forslund 1d7d02161d Add a default shutdown method for fallback skills
====  Tech Notes ====
Adds a shutdown method that removes all handlers registered by the
current instance.
2017-08-09 14:24:21 +02:00
Åke Forslund c363662b67 Remove need for name parameter
====  Tech Notes ====
If name is not provided the class name will be used
2017-08-09 14:18:14 +02:00
Åke Forslund 7f5f1ac2c1 Fix double __init__ in MycroftSkill
==== Fixed Issues ====
NONE

====  Tech Notes ====
During earlier rebase it seems like a double instance of __init__ got
into MycroftSkill.

====  Documentation Notes ====
NONE

==== Localization Notes ====
NONE

==== Environment Notes ====
NONE

==== Protocol Notes ====
NONE
2017-08-09 13:31:55 +02:00
reginaneon c96d0a3d5b Bug Fix
Bug fix proposed for success wake-word recording. 
Opt: Suggestion to change the save location of recording files as well. 
Otherwise, the user could potentially get the permission denial. 
-NeonGecko.com Inc
2017-08-08 15:38:58 -07:00
Åke ab22106659 Merge pull request #938 from MycroftAI/feature/fallbacks
Add intent fallback system

==== Fixed Issues ====
NONE - replace with issue numbers, e.g. #123, #304

====  Tech Notes ==== 
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ==== 
The FallbackSkill needs to be documented in detail for skill creators.


==== Environment Notes ==== 
NONE

==== Protocol Notes ====
multi_utterance_intent_failure replaced with complete_intent_failure
2017-08-08 21:00:51 +02:00
Åke Forslund 86cb1bb462 Fix message bus logging for audio service
==== Fixed Issues ====
#969

====  Tech Notes ====
The criteria for excluding messages were inverted and excluded all
messages containing 'mycroft.audio.service'. This criteria has been
fixed.

====  Documentation Notes ====
NONE - things like description of a new feature or notes on behavior
changes

==== Localization Notes ====
NONE - point out new strings, functions needing international versions,
     etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk,
etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, etc.
2017-08-08 14:23:02 +02:00
penrods c138182451 Fix the logger fix
Gotta slow down my fingers.  Mixed "logging" and "mycroft.util.log" into
the non-existent "mycroft.util.logging".  Fixed.
2017-08-03 16:56:55 -05:00
penrods 76ef80e443 Switch to mycroft.util.logger
Changed from a plain logger to mycroft.util.logger
2017-08-03 16:42:26 -05:00
penrods 54bf9b3cb6 Fix a missing logger which caused a crash
Some exception code was attempting to use the LOGGER, but one had
not been created for this file.  So when the exception occurred
it caused a crash.

NOTE: We need to standardize on log/LOG/LOGGER!
2017-08-03 16:42:26 -05:00
Michael Nguyen 4ae511812c Merge pull request #962 from MycroftAI/feature/display_state_manager
Feature/display state manager
2017-08-03 14:21:40 -05:00
Arron Atchison bdfdc1fec5 bump version to 0.8.20 2017-08-03 14:19:29 -05:00
Matthew D. Scholefield fee8ffab59 Change skill-wolfram-alpha to fallback-wolfram-alpha
This is necessary because of the API breaking change
2017-08-03 13:49:32 -05:00
Matthew D. Scholefield 6f1a2dbe55 Convert static methods in FallbackSkill to class methods
This makes it more concise and mimics the behavior of self, but for static methods
2017-08-03 13:49:32 -05:00
Matthew D. Scholefield 3b6942a250 Move intent fallback behavior to new FallbackSkill base class 2017-08-03 13:49:32 -05:00
Matthew D. Scholefield 4afe6687c4 Fix intent failed messages before running fallbacks 2017-08-03 13:49:02 -05:00
Matthew D. Scholefield a86f0478a4 Add intent fallback system
Also removes multi utterence intent fail. Only makes sense to emit an intent_failure regardless of the amount of intents
2017-08-03 13:49:02 -05:00
Michael Nguyen ee3391db29 pep8.. 2017-08-03 13:04:12 -05:00
Michael Nguyen 4355dad333 moved init disp websocket to enclosure 2017-08-03 13:01:11 -05:00
Åke Forslund db6127a0ed Catch exceptions in user provided stop() method
==== Fixed Issues ====
#960

====  Tech Notes ====
The messagebus handler for "mycroft.stop" halts and exits if an
exception occurs in any methods that are registered to that name. The
handler executes the stop() method that's provided by the user and is
not verified. To ensure that other skills are unaffected exceptions in
the user provided method are caught.

====  Documentation Notes ====
NONE - things like description of a new feature or notes on behavior
changes

==== Localization Notes ====
NONE - point out new strings, functions needing international versions,
etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk,
etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, etc.
2017-08-03 14:14:31 +02:00
Åke Forslund 5b4ae74cfb Make visime stream end together with audio
===Fixed issues ====
#958

====  Tech Notes ====
Adds method clear_visimes() to voice playback thread to stop visime stream
instead of having visime stream check for signals.

====  Documentation Notes ====
NONE - things like description of a new feature or notes on behavior
changes

==== Localization Notes ====
NONE - point out new strings, functions needing international versions,
     etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk,
etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, etc.
2017-08-03 10:57:14 +02:00
Åke Forslund a0ac65ac35 Fix rebase issues introduced with audio subsystem
util/signal.py add missing import time
move tts thread shutdown/clear to audio/speech.py
2017-08-02 16:53:48 -05:00
Michael Nguyen 58288b4c11 fixed permissions bug 2017-08-02 12:46:05 -05:00
Michael Nguyen c1041b9902 fixed permissions bug 2017-08-02 12:34:04 -05:00
Michael Nguyen 07b123db89 Merge pull request #944 from forslund/bugfix/issue-943
Remove volume parameter from default wav play cmd
2017-08-02 10:06:39 -05:00
Åke e7c55aaa43 Merge pull request #933 from MycroftAI/feature/skill-configuration
Feature/skill configuration
2017-08-02 08:57:28 +02:00
Åke Forslund ddf0e3578e Remove volume parameter from default wav play cmd
==== Fixed Issues ====
#943
2017-08-02 08:08:42 +02:00
Michael Nguyen b68baf1d57 change LOGGER to logger 2017-08-01 16:39:13 -05:00
Michael Nguyen 12c7302ac7 changed logger to LOGGER 2017-08-01 16:22:49 -05:00
Michael Nguyen 48b26d1fbd added new test and put back is_stored property 2017-08-01 13:52:51 -05:00
Åke Forslund df18f42ae0 Remove debug prints 2017-08-01 11:45:42 +02:00
Åke Forslund 9c49f97421 Audio service is_playing property 2017-07-31 13:37:18 +02:00
Åke Forslund 0e2029d9fe Add support for muting pulse audio streams
when the audio configuration option "pulseaudio" is set to mute running
audio streams will be muted while mycroft is speaking and while mycroft
is listening.
2017-07-31 13:37:18 +02:00