Commit Graph

2324 Commits (0faa2a4451d64571f81874bc9cd27a256a436564)

Author SHA1 Message Date
Åke 1300773f3d
Merge pull request #2104 from MycroftAI/feature/skill-gid
Feature/skill gid
2019-05-22 06:19:37 +02:00
Åke Forslund 716c16a027 Finalize skill_gid in skills manifest.
Before sending the skills manifest to the backend attach device uuid as needed.
2019-05-21 17:47:12 +02: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
Ruthvicp d2514b01be Remove additional space after initials 2019-05-16 17:27:51 -05:00
Åke fc7a3af14e
Merge pull request #2124 from MycroftAI/feature/upgrade-precise
Support chopping old audio via precise upgrade
2019-05-16 12:07:58 +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
Åke Forslund 1400af2b16 Fix pycodestyle errors 2019-05-15 13:46:43 +02:00
Matthew D. Scholefield dd71f24f29 Support chopping old audio via precise upgrade
This supports dropping audio buffers when the cpu falls behind so that the latency doesn't infinitely increase.
2019-05-15 02:38:33 -05:00
Åke Forslund 5ed417cddb Small style fixes
- Remove unneccessary pass
- Fix bare except statements
- Fix identation
2019-05-13 16:48:15 +02:00
Ruthvicp 90ccae2f69 Cache pre-loading for mimic2
When the mimic2 TTS instance is created the phrases from mycroft-core and mycroft-wifi setup (if available) is generated and stored locally (defaults to /opt/mycroft/preloaded_cache but can be changed with the mimic2 config parameter "preloaded_cache"

On startup the cache will be copied into the cache directory to speed up default interactions.
2019-05-13 14:33:30 +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
Kate Canaveral b95c8c990b Fix typo in mycroft.conf (#2119) 2019-05-12 23:11:41 -07:00
devs-mycroft b0157b46c8 Version bump from 19.2.6 to 19.2.7 2019-05-09 09:50:31 +00: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
Thomas Doczkal 59fd7233d8 typo (#2086)
Aprill .. April
2019-04-29 13:00:00 -05:00
devs-mycroft e966eee1b7 Version bump from 19.2.5 to 19.2.6 2019-04-25 12:14:50 +00:00
devs-mycroft 3e20433fd3 Version bump from 19.2.4 to 19.2.5 2019-04-25 09:24:07 +00:00
Åke 32636fe55f Set default log level to INFO (#2070)
* Set default log level to INFO

* Restore echo functionality

- Make sure that the mycroft.debug.log message isn't removed by the
whitelist
- whitelist now only checks the beginning of a message so a whitelisted
"mycroft.audio.service" will allow messages such as
"mycroft.audio.service.play"

* Make MycroftSkill.log track root logger

modify root logger when changing log level will now change the log level
of the skill logger.

* Changes for debugging

* Switched bus logging to use INFO instead of DEBUG so it always displays when turned on
* Add exception output
* Replaced multiple calls into a msg_type variable
2019-04-22 14:06:01 -05:00
Kris Gesling 947fadbe1f fix table formatting for docs display 2019-04-20 13:15:39 +09:30
Kris Gesling 88a822727c
Merge pull request #2095 from forslund/docs/tidying
Tidy up the readthedocs documentation
2019-04-20 03:02:56 +09:30
Matthew D. Scholefield 8c09f88e53
Merge pull request #2088 from forslund/feature/audioservice-list
Feature/audioservice list
2019-04-19 00:30:38 -05:00
jarbasal e256e3d1a6 restore bus on_message 2019-04-16 23:28:51 +01:00
Åke d2690979db
Merge pull request #2098 from MycroftAI/feature/precise-default
Change default listener in config
2019-04-16 13:41:27 +02:00
Åke 7a8ea0b5cc
Merge pull request #2099 from MycroftAI/commonIoT/trigger
Add trigger action
2019-04-16 11:15:34 +02:00
Åke 3841d5c13c
Merge pull request #2096 from MycroftAI/commonIoT/acknowledge
CommonIOT/acknowledge
2019-04-16 11:14:27 +02:00
Chris Rogers 8a75b77204 Add trigger action 2019-04-15 14:01:35 -04:00
Matthew D. Scholefield 794d91e7f7 Change default listener in config
It has been previously set using other configurations like /etc/mycroft.conf on the Mark 1
2019-04-15 11:11:21 -05:00
Chris Rogers b975f2f9cf file -> audio_file 2019-04-14 18:36:07 -04:00
Chris Rogers 6afadbed4c Remove wait 2019-04-14 18:32:01 -04:00
Chris Rogers 2a6f113151 Add function to acknowledge success non-verbally 2019-04-14 10:11:52 -04:00
Chris Rogers 61e4aeb55f Make temp, heat, ac things instead of attributes 2019-04-14 10:06:00 -04:00
Åke Forslund 6fbb49c1e9 Add some docstrings for CommonPlay/Query skills 2019-04-14 09:51:26 +02:00
Åke 566630d9e3 Fix infinily adding pages to existing namespace (#2093)
Update the local representation with the new pages when appending pages to an existing namespace.
2019-04-11 13:24:43 -05:00
devs-mycroft d0f55186cb Version bump from 19.2.3 to 19.2.4 2019-04-11 09:44:58 +00:00
Åke 0a887bf6bb Restore settings polling to 1 minute interval (#2091) 2019-04-10 13:38:58 -05:00
Åke 0593957508
Merge pull request #2089 from MycroftAI/feature/remove-stop-threshold
Remove "stop_threshold"
2019-04-10 11:59:17 +02:00
Steve Penrod dd976b6042 Fix bug with paused audio
The simple audio service can be paused.  The audio is "paused" but placing the
audio playback mechanism (usually aplay or mpg123) into the background, kinda
like hitting Ctrl+Z.  While in the background that process can no longer react
to the SIGTERM signal.  So paused audio has to be brought to the foreground
using SIGCONT, and _then_ sent SIGTERM.

Also added a belt to go with these suspenders and perform a process.kill() if
the audio process doesn't go away after 1 second.
2019-04-09 01:49:54 -05:00
Steve Penrod 663d6821b2 Remove "stop_threshold"
The setting "stop_threshold" is not used (and doesn't look like it ever was).  Removing
from mycroft.conf.
2019-04-08 23:01:54 -05:00
Chris Rogers 7641cc00b0 Add thermostat related attributes 2019-04-08 18:19:52 -04:00
Åke Forslund 9248be1691 Add list of available backends to audioservice
The message returned is a dict of all available audio backends as keys
containing 'supported_uris' listing supported uri types (file:// http://
etc.), 'remote' (bool) True if remote), 'default' (bool) true if the
default audio backend.
2019-04-08 15:28:56 +02:00
Åke Forslund 0d401c8757 Remove superfluous mycroft.stop handler removal 2019-04-08 15:13:34 +02:00
devs-mycroft 4b45db34ec Version bump from 19.2.2 to 19.2.3 2019-04-07 00:06:55 +00:00
Åke 031175ae89
Merge pull request #2084 from forslund/feature/settings_poll-time
Poll settings only every 5 minutes
2019-04-07 00:59:12 +02:00
Åke Forslund e63bce2a97 Clean the skills.json before sending it up.
- Only include the 'version', 'blacklist' and 'skills' field.
- remove duplicate entries (with the same name)  in 'skills' section
2019-04-07 00:36:25 +02:00
Åke Forslund bee167c875 Poll settings only every 5 minutes 2019-04-07 00:26:16 +02:00
Åke Forslund 54781a9249 Reverts back to 19.2.2
Revert "Fix a couple of minor issues intruduced by skill_gid (#2079)"

This reverts commit e046377ce1.

Revert "Merge pull request #2075 from forslund/bugfix/msm_wrapper-license"

This reverts commit 18cfbce0ca, reversing
changes made to 82fa314ce9.

Revert "Feature/skillsmeta gid (#2074)"

This reverts commit 82fa314ce9.
2019-04-07 00:01:36 +02:00
Åke e046377ce1 Fix a couple of minor issues intruduced by skill_gid (#2079)
- name collision for display_name function and variable
- name -> self.name
2019-04-05 16:43:47 -05:00
Åke 637166e624 Revert "Remove reliance on hashed meta (#2076)"
This reverts commit 38123a1fc3.
2019-04-05 17:57:06 +02:00
Åke 38123a1fc3 Remove reliance on hashed meta (#2076)
* Fix skill_gid for modified skills

Used the old '_' after device uuid

* Identify skill using gid

When receiving data from server the "identifier" entry is now removed and in it's stead the skill_gid should be used.

This also removes the "fetch other settings" functionallity since that is no longer relevant.
2019-04-04 02:03:08 -05:00
Åke Forslund f60d2372bb Add missing license header 2019-04-02 18:26:44 +02:00
Åke 82fa314ce9 Feature/skillsmeta gid (#2074)
* Add global id basics to settings meta

- All skills will upload a blank settingsmeta
- a skill_gid will be appended to all settingsmeta upload-data
- Added basic function for generating skill_gid

* Use new skill_gid field.

Populate skill_gid directly from metadata

* Separate travis tmp-dirs

- Update travis script to use tempdir for each python version
- Update test script to handle nonstandard tempdirs
- Generate msm folder using tempdir when running create_msm test

* Add title field with pretty name

* Collect and expand "title" as needed

For title use market-place title or name in settings meta or skillname

* Switch skill_manager create_msm test to 19.02

* Remove leading / trailing Skill in display name

Also rename title displayname to match new mycroft-skills-data

* Lock msm_create and mock the name info test_settings
2019-04-02 11:14:49 -05:00
devs-mycroft 6706c37782 Version bump from 19.2.1 to 19.2.2 2019-03-29 00:07:49 +00:00
Åke Forslund 466f187eb7 Remove extra LOG statement 2019-03-28 23:29:07 +01:00
Åke d2e6d310ad Run normalized also when raw matches None (#2073)
If no match was found for the non-normalized utterance it would jump to
the exception handler for StopIteration skipping the normalized step
altogether

This changes the next/StopIteration system for list comprehensions
2019-03-28 15:43:28 -05:00
Åke Forslund 381999d5a8 Minor issues
- padatious sentence defaults
- A bit more explanation about the adapt message utterance
2019-03-28 14:50:50 +01:00
Steve Penrod 342c730a97 Normalize utterances before intent handling
Previously Padatious intent matches were performed on non-normalized text, meaning that things like "what's the weather" wouldn't match a Padatious intent but
"what is the weather" would.

The "utterance" in Adapt intent data will still be non-normalized even if the intent match occurred on a normalized utterance. Retaining the existing behavior.

The "intent_failure" data.  In there, "utterance" is always the raw version, "norm_utt" is the normalized one.

Also added better debugging info for intent matching to the log.

Also addresses a rare issue with the old code where the Adapt context could
have been updated even if the Adapt intent wasn't actually invoked due to
a higher Padatious intent match.
2019-03-28 14:48:26 +01:00
Åke Forslund 6186afd25f Remove the mimic_fallback_obj at shutdown 2019-03-28 11:15:45 +01:00
Ruthvicp ba305c5bfc separate the cache & avoid voice overlap
- The cache is now stored in a TTS specific directory
- Only a single fallback-tts is created
2019-03-28 10:40:02 +01:00
jarbasal 64a58f3290 tonight remainder 2019-03-27 11:15:24 +00:00
Ruthvicp b28011681e handling tonight in date & time extraction (#2066)
* handling tonight in date & time extraction
2019-03-27 01:41:50 -05:00
Åke feb82a2bb1 Add the SkillGUI method send_event() (#2057)
* Add the SkillGUI method send_event()

Sends raw mycroft.events.triggered messages to the gui for the skills namespace.

Example usage:
  self.gui.send_event('event_name' {'param1': 12, 'param2': 'abc'})
2019-03-27 01:22:05 -05:00
jarbasal a788efd1d0 update to new lang scheme 2019-03-26 13:46:04 +01:00
jarbasal 42e258610e feature/format_pt 2019-03-26 13:45:59 +01:00
Åke ca1115979d
Merge pull request #2062 from MycroftAI/feature/timer-translations
Add translations from the Timer skill
2019-03-25 15:33:11 +01:00
Åke Forslund ea0d23b975 Fix day/hour/minute/second translations 2019-03-25 14:52:26 +01:00
Chris Rogers d04ad5f8b0 Remove enum.auto
Replace enum.auto with a similar, custom function. This is for python3.4
compatibility.
2019-03-24 14:07:49 -04:00
Åke e2b70d1fa4
Merge pull request #2060 from MycroftAI/feature/configurable-precise-threshold
Make precise sensitivity configurable
2019-03-22 22:33:49 +01:00
Åke 9eeb8cefc3 Fix mimic 2 long sentences (#2061)
* Fix mimic 2 long sentences

Fixes bug in  the second and third chunking pass incorrectly by
concatinating strings with lists resulting in chunks of single
characters.

* Handle mimic2 chunking correctly

- Move preprocessing from get_tts() to a method called from tts execute,
    this allows all parts to be spoken and the caching to work correctly
- Remove duplicate of phonetic spelling in mimic2_tts
2019-03-22 10:20:06 -05:00
Steve Penrod 93cf07e9ed Add translations from the Timer skill
Moved translated text from the Timer skill into core.  This began
the mycroft-core translation effort for Russian and Turkish!
2019-03-22 09:55:13 -05:00
Matthew D. Scholefield a9fb77a27c Make precise sensitivity configurable 2019-03-21 17:45:38 -05:00
Åke dfa714c56d
Merge pull request #2059 from MycroftAI/feature/padatious-priority
Adjust and document Padatious loose fallback priority
2019-03-21 23:38:25 +01:00
Steve Penrod 41773a039a Adjust and document Padatious loose fallback priority
The loose (conf > 0.5) Padatious match was previously occurring as Fallback
priority 99. The AIML fallback at priority 90 would consume lots of
utterances, interferring with many skills.  Now Padatious runs at priority
89.

Additionally, added documentation of the intent and fallback system, including
guidelines for priorities.
2019-03-21 17:16:07 -05:00
Åke 9f29649fc0 Feature/non hard coded paths (#2058)
* Allow ~ when running ensure_directory_exists

* Add custom paths for websettings cache and system conf
2019-03-21 13:19:11 -05:00
Åke 66f9f3f100
Merge pull request #2012 from MycroftAI/bugfix/audio-protection
Protect against failure to launch WAV/MP3
2019-03-15 10:28:17 +01:00
Steve Penrod 688d0e6704 Protect against failure to launch WAV/MP3/Ogg
The playback of WAV/MP3 could throw exceptions if something went
wrong, which seemed inappropriate.  Now it just generates an error
message in the log.
2019-03-15 09:57:04 +01:00
devs-mycroft 8228b49230 Version bump from 19.2.0 to 19.2.1 2019-03-14 20:54:39 +00:00
Åke Forslund c3f2b73794 set_active_lang on startup of skills 2019-03-14 11:00:51 +01:00
Steve Penrod a5dcc8d3d3 Fix unit test errors 2019-03-14 10:57:31 +01:00
Steve Penrod 44f60ec6f3 Change default lang to None, not English
Much of the code used "en-us" as the default value when not specified.
This limited the internationalization potential.  Changing the default
to None and adds the ability to define the default lang code from other
locations in code.  E.g.

```python

from mycroft.util.lang import set_default_lang

set_default_lang("en-us")
print("English date: "+nice_date(dt))

set_default_lang("de-de")
print("German date: "+nice_date(dt))
```

This allows easier localization of Skills by having the framework set the default without any changes necessary by the Skill writers.

Other minor changes:
* Changed the default return value of get_gender*() to None instead of False
2019-03-14 10:57:31 +01:00
ChristopherRogers1991 ffd58cb4ef Feature/common io t updates (#2050)
* Split ADJUST into ADJUST and SET

* Use enum names instead of values.

* Add properties to CommonIoTSkill

* property -> attribute to avoid conflict with builtin

* Add increase and decrease actions

* Fix copy/paste error
2019-03-13 22:51:54 -05:00
Åke 327511c937 Fix simple audio backend pausing by voice (#2045)
The restore_volume would previously unpause the service even if the user just asked for pausing playback.

This separates the paused flag from the pausing/resuming action so lowering/restoring volume doesn't affect the logical pausing state and can check it to determine if lowering/restoring is needed/wanted.
2019-03-08 02:24:58 -06:00
Åke 20ee4fddf0
Merge pull request #2044 from MycroftAI/feature/simple-audio-pausing
Add pause/resume to simple audio services
2019-03-08 08:46:51 +01:00
Steve Penrod dd25b76be6 Add pause/resume to simple audio services
This adds a very simple mechanism for pausing and resuming audio streams
that are actively playing.  The process is suspended and resumed when
requested.

This also uses that same method to implement lower_volume()/restore_volume() for simple "ducking" of audio.
2019-03-07 17:40:59 -06:00
Steve Penrod cd6db9f645 Bugfix for Mimic2 issues (#2043)
Mimic2 voices has several issues:
* Numeric generation was all goofed up for decimal numbers.  It was
  independently doing number to speech for the values before and after
  the period on a decimal number.  E.g. 1.100 became "one.one hundred".
  Removed local normalization altogether since it is handled
  correctly on the Mimic2 server now.
* Sentence splitting was being applied in the middle of things like
  numbers or abbreviations.  E.g. "I.B.M."
* Chunker algorithms were making unnecessary copies of string arrays

While in there I also:
* Removed several unused imports
* Cleaned up docstrings
* Prefixed private helpers with _
* Added debug logging of mimic2 request text
2019-03-07 14:55:31 -06:00
Åke 526d326ecf Mute the mic while playing the listening "beep" (#2042)
This also extends the stream mute to actually stopping the recording stream while muted.
2019-03-07 13:42:00 -06:00
Steve Penrod 230c3057b4 Give Padatious high and low match passes
Padatious was accepting fairly low confidence matches (0.5).  This
would match a phrase such as "Where is the Empire State Building?" to the
intent "Where were you born?"  (Which is a 0.54 match)

Now there are two passes mad on the Padatious fallback.  The first is
looking for high confidence matches (> 0.8).  Then other fallbacks -- such
as the CommonQuery fallbacks -- have an opportunity to consume the
utterance.  If they don't consume it, Padatious is invoked again with
looser confidence before finally invoking the Unknown fallback.
2019-03-05 03:33:02 -06:00
Andreas Lorensen 6c0cd8d427 Add danish 2 - initial work to get danish to core (#2033)
* Danish formatting and parsing functions
2019-03-04 21:40:12 +01:00
Angel Docampo fdeb66c3e4 Fixed pep8 issues 2019-03-04 15:37:28 +01:00
Angel Docampo 9c22ced394 Initial castillian format translations
This commit add the initial translations of core functions for format
numbers: nice_number_es, pronounce_number_es and nice_time_es.

==== Localization Notes ====
NONE - Castillian (Spain's spanish)
2019-03-04 15:37:10 +01:00
devs-mycroft 5f714957d4 Version bump from 19.2.-1 to 19.2.0 2019-02-28 23:32:21 +00:00
Steve Penrod 286fa6314f Imporove user feedback during startup
Now the eyes go to a khaki color and "< < < LOADING < < <" displays
during the skill startup.  When Padatious finishes the first training
we now emit a "mycroft.ready" on the messagebus.

A change to the skill_mark_1 to look for "mycroft.ready" instead of
"mycroft.skills.initialized" provides a good visual change to show that
it is ready for use.
2019-02-28 14:58:19 -06:00
Åke 5529acde12
Merge pull request #2030 from MycroftAI/bugfix/hide-warnings
Hide deprecated warning in certain cases
2019-02-28 21:12:17 +01:00
Steve Penrod f5025f5eaf Fix PEP8 2019-02-28 13:15:03 -06:00
Steve Penrod 419a8c531d Hide deprecated warning in certain cases
The deprecation warning was firing off at the load of every skill when
the decorators are being iterated through by internal code (which
includes the self.config with an @property).  Add check for these
special cases to not show a warning.
2019-02-28 13:11:07 -06:00
Steve Penrod 603973ecf3 Typo in Common Query 'encolsure'
Fixed a type in the Common Query scoring system that broke a bonus check.
2019-02-28 12:39:38 -06:00
Åke 0c111bb60c
Merge pull request #2028 from MycroftAI/bugfix/inhibit-visemes
Activate/deactivate visemes on command
2019-02-28 16:53:38 +01:00
Åke Forslund 3d366013b9 Activate/deactivate visemes on command
When showing text the visemes would overwrite it. This inhibits the visemes when mouth events are turned off and reenables them when activated.
2019-02-28 16:04:43 +01:00
Åke b1123eade8
Merge pull request #2026 from MycroftAI/feature/tweak-common-play-scoring
Tweak CommonPlay scoring
2019-02-28 11:41:40 +01:00
Åke 85342080e5
Merge pull request #2027 from MycroftAI/feature/new-beep
More subtle "listening" sound
2019-02-28 11:18:21 +01:00
Steve Penrod df6a3700d9 More subtle "listening" sound 2019-02-28 04:16:58 -06:00
Steve Penrod d25d91e034 Tweak CommonPlay scoring
The scoring for CommonPlay would favor skills that responded with overly long
matches.  E.g. "Huey Lewis and the News" would be considered a better fit than
just "News" for the request "Play the News"
2019-02-28 11:06:52 +01:00
Steve Penrod d65555c327 Deprecate self.config in skills (#2025)
* Deprecate self.config in skills

Skills should contain their own settings, the self.config concept is being
deprecated.

Also removed the defaults set for several old MycroftAI skills.  The 19.02
version of these Skills initializes the default values using:
```python
self.settings["key"] = default
```

* Update padatious config to work with the config property.
2019-02-28 10:50:08 +01:00
Åke 07c2a93324 Feature/threaded emitter for real (#2024)
* Run emitter using threadpool

This moves the thread pool from the websocket client into the eventemitter allowing each registered function to run in a separate thread and not just each event.

This speeds up cases where there is a one to many call such as the common play framework and the upcomming common query framework.

* Add unit tests for threaded event emitter

* Add standard header

* Add standard header
2019-02-28 03:04:51 -06:00
ChristopherRogers1991 cf5d7b80c5 Feature/common io t (#2015)
* Add base common_iot_skill

* can_run takes IoTRequest

* Minor cleanup + documentation

* Fix pep8 issues

* Adjust scene and entity registration.

The controller skill is not guaranteed to be alive before
CommonIoTSkills, so we must call for values when it is alive, in
addition to accepting them at any time from other skills.

* Safer parsing

* Address PR feedback

* Add skill_id to register message

* Minor docstring edits
2019-02-28 01:31:03 -06:00
Åke ff6d7ed164
Merge pull request #2003 from MycroftAI/feature/19.02-versions
Update versions to 19.02
2019-02-28 08:19:30 +01:00
Ruthvicp ec7ed25ed5 date and time - for tonight, weekdays (#2023)
* date and time - for tonight, weekdays

* Updating the previous commit test_extractdatetime_en

* Editing comments for extract_date_time_en

* Generalized as a marker

Expanded this from just handling "weekends" to any day or plural of the day, "weekend", "weekday" or "weekdays".
2019-02-28 01:15:55 -06:00
Åke d3e6a10ecc GUI Remove pages/namespaces (#2002)
* Add remove page methods

* Implement SkillGUI.clear()

The method will now remove the namespace entirely from the gui.

This adds the message gui.clear.namespace

* Remove debug prints from SkillGUI

* Correcting docstring

* More docstring changes

* Remove whitespace added by Github webUI
2019-02-28 00:21:08 -06:00
Åke 8e495870c2 Feature/skill manager error checks (#1981)
* Attempt to create skill directory if not existing

* Handle missing priority skills

* Minor update of comments

* Handle skill load exception

Make sure an exception while trying to load/reload skill doesn't shutdown thread.

* Handle MsmException during SkillManager creation

If SkillManager can't be created due to an MsmException wait for network connection and retry.

* Update immediately if skill install file is missing

Missing skill install file indicates that this is a new venv and the requirements of the skills will need to be reinstalled.

* Add basic test for skill_manager

Basically only creating the skill_manager but it ensures that msm can be used on all supported python versions
2019-02-28 00:18:48 -06:00
Åke 6c14d7bc36 Refactor/19.02 removes (#2019)
* Remove the deprecated emitter

* Remove channels config key for listener

This has never been used.
2019-02-28 00:09:47 -06:00
Åke 11dae04451 Feature/threaded emitter (#2008)
* Update to pyee 5.0.0

- Update requirement
- Make the SkillSettings class hashable

* Update adapt to 0.3.2

* Upgrade websocket-client

* Remove special threading for common query
2019-02-27 23:41:52 -06:00
Åke 71088f8fcb Feature/update requirements (#1998)
* Update to pyee 5.0.0

- Update requirement
- Make the SkillSettings class hashable

* Update adapt to 0.3.2

* Upgrade websocket-client
2019-02-27 23:41:24 -06:00
Luis Reinoso 62f0abf021 Issues-1982 - Add input validation 2019-02-27 10:39:22 +01:00
Luis Reinoso bb6de01e72 Issues-1982 - Add IAM authentication for Watson TTS 2019-02-27 10:39:05 +01:00
Ale df7dfaa006 Update parse_it.py to 18.8.12 (#1990)
* update functions in parse_it.py
* update tests
* translate docstrings to english
2019-02-27 08:00:50 +01:00
Åke 84754668a6
Merge pull request #2018 from MycroftAI/refactor/default-message-vals
Add default values to Message attributes
2019-02-26 16:34:17 +01:00
Åke Forslund be72733abb Fix context checks
- intent_service
- MycroftSkill
2019-02-26 15:46:12 +01:00
Åke 4de2bee18c
Merge pull request #2017 from MycroftAI/feature/first-boot-check
Try updating the system on boot when not paired
2019-02-26 13:53:09 +01:00
Åke ded9f8a11d
Merge pull request #2016 from MycroftAI/feature/ntp-reply
Wait for ntp sync complete message
2019-02-26 10:52:49 +01:00
Matthew D. Scholefield 42ea785fd8 Add default values to Message attributes
This ensures no attributes are None and simplifies some checks within the function
Otherwise, if, for instance, there were no 'data' field in a message, when deserializing, the caller would have to check for None
2019-02-26 02:44:19 -06:00
Matthew D. Scholefield af2b448321 Try updating the system on boot when not paired
This sends a new system.update.check message when the device is booted and not paired
It is not sent every boot because the command could upgrade across major versions which the user could not want.
2019-02-26 02:37:59 -06:00
Matthew D. Scholefield 59ede0de8c Wait for ntp sync complete message
We can easily wait for the message, even if it doesn't exist
2019-02-26 00:55:51 -06:00
Åke e51e35f622
Merge pull request #2014 from MycroftAI/feature/fix-extract-duration
Correct extract_duration doc and failure value
2019-02-25 09:12:03 +01:00
Steve Penrod 684363ffaf Correct extract_duration doc and failure value
The documentation indicated an array instead of a tuple, plus
the default return value didn't match the documented return type.
2019-02-25 01:54:58 -06:00
Åke b59fa51b1e remove compaitbility methods for installer skill (#2006)
- load_skills_data()
- write_skills_data()
2019-02-25 00:42:06 -06:00
Åke faf29d1fef
Merge pull request #2009 from MycroftAI/bugfix/voc-match
Fix behavior of MycroftSkills.voc_match()
2019-02-24 15:50:25 +01:00
Åke Forslund 40eca55cf2 Expand .voc files in MycroftSkill.voc_match()
- Create a read_vocab_file() function that normal vocab loading and voc_match both uses. This function handles blank lines and comments
- Use a simpler regex instead of word logic to match
- Add a couple of test cases for the method
2019-02-22 18:49:01 +01:00
Åke b4fc3ab389
Merge pull request #2011 from MycroftAI/feature/logging-control
Improve debug logging
2019-02-22 17:37:32 +01:00
Åke Forslund 5ce4754d94 Cleanup of broken and incorrect code
- Fix pep8 in util/__init__
- Remove half done if statement and fix codacy in text_client.py
- CAPITALIZE the log levels
2019-02-22 14:54:28 +01:00
Åke Forslund ae577a7ad7 Also update the log level of urllib3 2019-02-22 14:34:10 +01:00
Åke Forslund 53b0f34220 Fix setting log level 2019-02-22 14:33:21 +01:00
Steve Penrod deb3721f13
Fix PEP8 issues 2019-02-22 05:16:38 -06:00
Steve Penrod fbcfe6c816 Improve debug logging
Several changes to the logging using in all processes:
* Disable logging of bus messages by default (massively cleans up the logs)
* Add "mycroft.debug.log" bus message.  It supports the data={"bus": True/False} as well as
  data={"log": LEVEL}, where level is a Python logging level.

CLI now supports several commands:
* ```:log level XXX``` where XXX is the name of a standard Python level (e.g. 'debug')
* ```:log bus on``` or ```:log bus off```
* Removed the requirement for "log" in ```:clear log```.  ```:clear``` works now.
2019-02-22 05:11:16 -06:00
Steve Penrod ed971ed1a9 Fix bug in the mic-level meter
The mic-level meter that appears in the Mycroft CLI could stop updating in
rare cases when a file I/O operation failed.  It would also fail to show
a meter ever if the mic_level file hadn't been created before the CLI was
started.
2019-02-22 11:54:00 +01:00
Steve Penrod eac364f0f8 Fix behavior of MycroftSkills.voc_match()
Previously the voc_match() method had several problems:
* Blank lines in the .voc file would cause it to match all strings
* Comments weren't ignored
* Substrings matched so "book" would match "ok", for instance
2019-02-22 04:25:57 -06:00
Åke d26650b143
Merge pull request #2004 from MycroftAI/feature/tweak-datetime-parse
Tweak English extract_datetime() parsing
2019-02-20 14:05:32 +01:00
Steve Penrod 631875d9c2 Tweak English extract_datetime() parsing
Ambiguous times previously used a generally unexpected rule about
when to jump 12 hours when parsing times.  Now it follows the rule:
If a time is spoken without am/pm indicator, assume the next time
that hasn't passed was intended.

For example:
  "at 7 o'clock"
Would mean 7:00am if spoken at 6:59am, but would mean 7:00pm
if spoken at 7:01am.
2019-02-20 01:56:20 -06:00
Andreas Reinle 13dcdd3b26 Add German date formatting and support for join_list and/or 2019-02-19 08:08:23 +01:00
Åke Forslund 11dd76dd6d Bump version for the 19.02 release 2019-02-18 18:27:09 +01:00
Åke Forslund 26be970ae1 Update default msm branch to 19.02. 2019-02-18 18:27:09 +01:00
Åke 7674fa1c65
Merge pull request #1995 from MycroftAI/feature/settings-cleanup
Clean up some exception handling in settings code
2019-02-18 09:11:01 +01:00
Åke ba24cc3d78 Feature/remove old viseme system (#2000)
* Remove the old single viseme message

Instead a single viseme message is sent

* Correct the spelling of viseme.

Ref: https://en.wikipedia.org/wiki/Viseme

* Remove debug print.

This was probably left in by mistake, removing to clean up the audio log somewhat.
2019-02-17 23:54:59 -06:00
Steve Penrod fb6bde0885 Fix rare settings bug
In the case where a network call during the initialization of the
settings poll fails the first time, it would never be tried again.
Now it will retry initialization once a minute.
2019-02-15 14:48:22 -06:00
Matthew D. Scholefield 64571924e7 Add (|) syntax to dialog and voc files 2019-02-15 12:05:39 -06:00
Ruthvicp d3015ca7e8 Pause at semicolon (#1989)
Split at semicolon and speak each chunk of data, similar to a period.
2019-02-15 02:54:42 -06:00
Åke 13194dd301
Merge pull request #1992 from MycroftAI/alistair23-alistair/utf8-encoding
Load .voc and .rx as utf-8
2019-02-15 09:02:14 +01:00
Steve Penrod 6b80d933ec Handle several other potential failure points
Several API calls weren't surrounded by any error handling.
2019-02-14 17:05:41 -06:00
Steve Penrod a76c3a6e7a Quiet PEP8 2019-02-14 15:49:05 -06:00
Steve Penrod de818db9cb Clean up some exception handling in settings code
The settings code worked, but was noisy and generally messy about
a few exceptional but common situations:
* When the .mycroft/skills/<SkillName> folder didn't already exist
* When network timeouts and such occcurred

I also slipped in a couple trivial code cleanups for an unused variable
and a log message.
2019-02-14 15:41:27 -06:00
devs-mycroft 040a78cb6b Version bump from 18.8.12 to 18.8.13 2019-02-14 12:07:24 +00:00
Åke 1a9302418d
Merge pull request #1991 from MycroftAI/bigfix/hyper-critical-typo-fix
Correcting a typo
2019-02-13 21:08:34 +01:00
Åke Forslund 4a9aae4fea Load the settingsmeta as utf-8
the settings meta is also distributed by skills and should be considered to be utf-8 no matter the system settings.
2019-02-13 21:06:06 +01:00
Alistair Francis edafce059d skills: Open all skill data files as utf8 encoded
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> and Åke Forslund <ake.forslund@gmail.com>
2019-02-13 21:05:18 +01:00
Steve Penrod 22323827c5 Correcting a typo
This typo has been lingering waiting for an adjacent change.
I just want it out of my commit list.  :)
2019-02-13 12:22:27 -06:00
Åke 65a7197519
Merge pull request #1977 from ChristopherRogers1991/feature/issue-1959
Add extract_duration() method
2019-02-13 16:08:49 +01:00
Steve Penrod 065273bf4f New formatters: nice_duration() and join_list() (#1988)
* New formatters:  nice_duration() and join_list()

Adding two new formatting functions:
* nice_duration(duration, lang="en-us", speech=True)
  Accept seconds or duration and produce a nice sounding duration.
  Example:  nice_duration(61) == "one minute one second"
            nice_duration(61, speech=False) == "1:01"
* join_list(items, connector, sep=None, lang="en-us")
  Example:  join_list(["a", "b", "c"], "and") == "a, b and c"

This includes a translation helper that uses text files in the
mycroft/res/text/LANG/ directory, such as "second.word".
2019-02-13 12:52:35 +01:00
Chris Rogers 113352339d Fix pep8 issues.
This is in support of issues-1959.
2019-02-12 17:29:21 -05:00
Chris Rogers 4bca969316 Log unsupported languages.
This extracts the logging logic that was being used in a few places to
indicate certain parcing functions are not supported in particular
languages, and adds the logging to extract_duration.
2019-02-12 17:01:16 -05:00
Chris Rogers acbe46aede Fix documentation
Fix typo and add an explanation for
_extract_number_with_text_en_helper.
2019-02-12 16:36:11 -05:00
Chris Rogers cc0d3da62c Change _Token to a namedtuple.
This is in support of issues-1959.
2019-02-12 16:23:53 -05:00
Åke 7e15366fc2
Merge pull request #1980 from MycroftAI/feature/doc-save-utt
Replace "record_utterances" config option with "save_utterances" option and improve flag documentation.
2019-02-11 21:25:02 +01:00
Ale 307910e53e update format_it.py test_format_it.py (#1984)
* Update format_it.py and tests
2019-02-11 18:07:14 +01:00
Åke Forslund bcae0ac4bd Update default config
- Move "save_utterenaces" comments to correct block
- Correct information, records utterance not wakeword
- replace "record_utterances" with the new "save_utterances"
2019-02-11 15:52:48 +01:00
Steve Penrod 2424fd1c9b Change to "save_utterances" instead of "record_utterances"
Change to match the documented and more intuitive name "save_utterances",
but add backwards compatibility code to support the original
"record_utterances".
2019-02-11 01:53:28 -06:00
Steve Penrod 28f18b745d
Document "save_utterance" option
The Listener has an option to save the sound that was recognized as a wake-word.   This isn't new functionality, but was previously undocumented.
2019-02-04 15:34:37 -06:00
Chris Rogers 1bb74f5c79 Use isinstance instead of type.
This is in support of issues-1959.
2019-02-03 12:58:31 -05:00
Chris Rogers cdf7dc3756 Use datetime.timedelta for extract_duration_en.
This is in support of issues-1959.
2019-02-03 12:16:36 -05:00
Chris Rogers d50cb00de8 Fix pep8 issues.
This is in support of issues-1959.
2019-02-02 14:21:37 -05:00
Chris Rogers 9e193c74e0 Make constant and functions private.
Making things weak private, to limit surface area of support. As things
become increasingly stable/tested/useful, it may make sense to open them
up, but for now, keeping them private will limit risk.

This is in support of issue-1959.
2019-02-02 14:07:48 -05:00
Chris Rogers 351381bca2 Fix pep8 issues.
This is in support of issues-1959.
2019-02-02 14:03:19 -05:00
Chris Rogers 7049e65cbe Minor shuffling + update docs.
After many changes, things had gotten a little disorganized, and the
docs were a little out of date. This brings them up to date.

This is in support of issues-1959.
2019-02-02 13:45:22 -05:00
Chris Rogers 534ca2aff9 All regressions in number parsing fixed.
This is in support of issues-1959.
2019-02-02 13:12:25 -05:00
Chris Rogers 6da1ec5c6e Fix regression in number parsing.
Fix regression that caused "X and one half" to parse as just X.

This is in support of issues-1959.
2019-02-01 23:24:45 -05:00
Chris Rogers f4eee8726a Refactor many methods in parse_en.
This improves the utility of the _ReplaceableNumber class, and updates
most of the number parsing functions to take tokens rather than text.
This simplifies the interactions between many of the functions, as there
is no need to convert back and forth between text and tokens.

This also adds some tests. Note that there are a few regressions that
will be fixed in a subsequent commit.
2019-02-01 23:04:54 -05:00
Chris Rogers 95aca10294 Fix _extract_decimal
Actually use the short_scale and ordinals values.
2019-02-01 18:57:28 -05:00
Chris Rogers 2ce632389f Fix and simplfy extract_numbers_en
This was calling convert_words_to_numbers and parsing out the resuling
numbers, which was a simple way of getting the numebrs in order, but it
choked on anything that didn't match the regex being used to parse
numbers, in particular numbers of the form '6e18'. The better solution
is to directly use extract_numbers_with_text (which now sorts by
start_index) and get the values from there directly.

This is in support of issues-1959.
2019-02-01 18:51:03 -05:00
Chris Rogers 6645ab6bfe Add short_scale and ordinal args to helpers.
This is in support of issues-1959.
2019-02-01 18:28:40 -05:00
Chris Rogers 5c74789c2d Lower text before parsing.
This is in support of issues-1959.
2019-02-01 18:21:13 -05:00
Chris Rogers 23edb9eb00 Fix decimal/fraction parsing with leading numbers.
"Five hours seven and a half minutes" was parsing as 5.5. This is
resolved. Multiple fractions/decimals still cause problems, e.g.

convert_words_to_numbers("seven and a half and nine and a half")
Out[5]: '7 and a 0.5 and 9 and a 0.5'

This is in support of issues-1959.
2019-02-01 17:39:01 -05:00
devs-mycroft b8beadfbf2 Version bump from 18.8.11 to 18.8.12 2019-01-31 14:03:20 +00:00
Åke 31656d6294 Add tests for commented dialogs and DialogLoader (#1853)
* Add tests for DialogLoader

* Handle Path/PosixPath

LOG messages when files/directories were missing would fail when a PosixPath/Path object was sent to as argument. This uses format to get the correct string representation.

* Add test for dialog.get()
2019-01-31 02:34:44 -06:00
Åke 8ff2ccc4fa
Merge pull request #1963 from forslund/feature/audioservice-prefer-local
Play on local audiobackends before trying remotes
2019-01-31 09:09:32 +01:00
Steve Penrod 01ea0afdeb
Minor edit of comments 2019-01-31 01:46:35 -06:00
Åke a94019a8b8 Use language set in mycroft configuration (#1925)
Slight refactoring to accommodate for this in a nice way. Created
function connect_to_mycroft() handling fetching the config and
connecting to the mycroft messagebus since these are related and the
order is important to maintain for it to work.
2019-01-31 01:38:47 -06:00
Åke 6b09770957
Merge pull request #1971 from forslund/feature/audio-test-basic-info
Add some additional info to audiotest
2019-01-31 08:36:46 +01:00
Åke 0ae66c3f93 Bugfix/speech stop (#1961)
* Refactor mimic2 to use the shared tts architecture

* Make sure the queue is cleared

- Add a convenience method grouping clear_queue and clear_visemes
- The start time is now set before the lock to allow multiple speech requests queued before the stop signal to also be cancelled
- Make sure the any pending TTS generation is cleared from the queue by calling tts.clear() when breaking from the chunking loop.
2019-01-31 01:30:53 -06:00
Åke 0a686be7d1 Add a decorator for simply adding idle pages (#1970)
To simplify the process of adding an idle page to a skill the decorator "resting_screen_handler" was added. In a skill class the decorator can be applied to a method to register it to handle idle.

    @resting_page_handler("My Idle Page")
    def handler(self, message):
        ...

The decorator will Register the method with the Mark-2 skill and perform all communications needed to make it work smoothly.
2019-01-31 01:22:33 -06:00
Steve Penrod df4f6ca6dd Fix typo and add --list option
The -l / --list option will now display the name and index of all available input devices.
2019-01-31 08:19:21 +01:00
Åke 267c7bf571 Single viseme message (#1973)
* Add new api command to send visemes as single list.  This allows more efficient use of the messagebus and gives implementors flexibility in how they handle the visualization.

* Switch mark1 to use viseme_list
2019-01-31 00:37:55 -06:00