Commit Graph

1964 Commits (136f1af8c3a82beb669ada69e188ae447c98ebec)

Author SHA1 Message Date
Matthew D. Scholefield 0f9df9efa0 Modifications for wifi-setup rework 2017-12-05 17:47:00 -06:00
penrods 553b95643e Add support for unnamed intents
This allows skill writers to ignore naming intents.  Combined with a
forthcoming change to Adapt that creates a default of None for IntentBuilder()

This allows the current:
    @intent_handler(IntentBuilder("CurrentWeatherIntent").require(
        "Weather").optionally("Location").build())
    def handle_current_weather(self, message):
        ...

To become:
    @intent_handler(IntentBuilder().require("Weather").optionally("Location"))
    def handle_current_weather(self, message):
        ...

Which will automatically name the Intent "handle_current_weather".

Also dropped the log message in the default initialize() method since it is
common to not override it now.
2017-12-05 11:18:12 -06:00
Åke a6d86b07c1
Merge pull request #1276 from MycroftAI/bugfix/skill-metrics
Fix skill metrics
2017-12-04 08:34:14 +01:00
Åke 026464b1df
Merge pull request #1277 from MycroftAI/feature/gitignore
Add generated json files to gitignore
2017-12-02 09:37:07 +01:00
Matthew D. Scholefield 255441c204 Add generated json files to gitignore 2017-12-01 18:31:46 -06:00
Matthew D. Scholefield 7f7d8f703c Fix skill metrics 2017-12-01 15:17:40 -06:00
JarbasAI 53481a265d allow phonemes in any lang (#1264)
Add possibility to set language per hotword. If not specified will use global language setting.
2017-11-29 10:56:35 +01:00
Åke Forslund ab93ee5fc9 Allow spaces around key in dialog template file 2017-11-28 22:57:34 -06:00
devs-mycroft 8a2595e85c Version bump from 0.9.6 to 0.9.7 2017-11-24 15:45:13 +00:00
Åke 95ab32bb86
Merge pull request #1258 from forslund/bugfix/start-speech-client-with-no-net
Handle ConnectionError when retrieving user id in MutableMicrophone
2017-11-24 13:22:17 +01:00
Åke 4a615ae2d4
Merge pull request #1254 from KathyReid/dev
Added section on proxy authentication config, partially resolves #1245
2017-11-24 11:26:27 +01:00
Åke Forslund 6083cbce07 Handle ConnectionError when retrieving user id
If the machine is not connected to the network getting the user uuid in MutableMic.__init__ will fail, raising ConnectionError. This caused the speech client to crash.

Adding handler for ConnectionError resolves this issue.
2017-11-24 10:54:36 +01:00
KathyReid 057c440663 Fix extraneous space - typo 2017-11-24 20:05:17 +11:00
Åke ec1fdf928d
Merge pull request #1253 from forslund/bugfix/unicode-encoded-dialogs
Fix handling of unicode strings in dialog renderer
2017-11-23 17:44:34 +01:00
KathyReid f18c712d53 Added section on proxy authentication configuration, partially resolves #1245 2017-11-24 00:29:43 +11:00
Åke Forslund dd9ffbac8f Fix handling of unicode strings in dialog renerer 2017-11-23 14:16:04 +01:00
Åke 941e01ad34
Merge pull request #1247 from MycroftAI/feature/metrics
Add general metrics reporting
2017-11-23 09:02:15 +01:00
Matthew D. Scholefield be638de12b Add general metrics 2017-11-22 23:39:14 -06:00
gaurav 3a40014122 Issue-1227 Fix arg =[] and ={}
Issue-1227 fixed line length

Issue-1227 fixed pep 8 E124

Issue-1227 fixed formatting
2017-11-22 23:17:16 -06:00
Augusto Monteiro 2bcfd9fde9
Merge pull request #1218 from forslund/bugfix/messagebus-send-ioerror
Handle missing messagebus in a correct way
2017-11-22 22:03:31 -05:00
Augusto Monteiro 3f281e83b5
Merge pull request #1251 from forslund/feature/reduce-config-file-loading
Reduce unneccessary loading of configuration files
2017-11-22 22:02:13 -05:00
Åke c9ac67d15b
Merge pull request #1250 from MycroftAI/feature/fix-1242
Fix viseme bug from PR #1242
2017-11-23 00:22:52 +01:00
penrods 8cb1e80bbe Fix viseme bug from PR #1242
I merged code and left out the 'until' value from the api call.  This
corrects that and deals with a missing 'until' cleaner.
2017-11-22 17:08:35 -06:00
Åke Forslund 5571b4d2cd Reduce unneccessary loading of configuration files
====  Tech Notes ====
Configuration.get() was originally thought to take a stack of configuration dicts and merge together into a single configuration dict but can also handle file paths.

The Api() class can't use the RemoteConfig class so it has supplied it's own stack of configuration files to avoid infinite recursion. Previously the files wore converted to dicts before passed into the Configuration which meant that 3 files were loaded even if the information was already cached. This passes the files as file references that will only be converted to dicts if the cache is not found.
2017-11-23 00:02:02 +01:00
Michael Nguyen 689687ef60
Merge pull request #1249 from MycroftAI/feature/namless-label
Allow name-less label in settingmeta.json
2017-11-22 16:07:16 -06:00
penrods c8a0cffa53 Allow name-less label in settingmeta.json
A type='label' field in the settingmeta.json might not have a field name,
which was causing a crash.
2017-11-22 15:34:40 -06:00
Åke 799ff1d231
Merge pull request #1248 from MycroftAI/feature/min-wait-time
Increase min wait time in wait_while_speaking()
2017-11-22 20:33:21 +01:00
Michael Nguyen 4c6b57c5c5
Merge pull request #1197 from forslund/feature/audioservice-update
Feature/audioservice update
2017-11-22 13:27:15 -06:00
penrods 55b3f20bf3 Increase min wait time in wait_while_speaking()
In code like this:
   self.speak_dialog("something")
   mycroft.audio.wait_while_speaking()
It was possible that the speaking of "something" would take longer to
start than the 0.1 seconds that was built into the wait_while_speaking().
The definition of this behavior is slightly fuzzy, but this is definitely
a case where the expectation is that previous request for speech would
start and complete.  For now, I have just bumped the minimum wait to
0.3 seconds.

In the long run we might consider tracking specific speak requests and
generating a notification when that request has been serviced.  Then the
skill could automatically hold off until that request has been serviced.
But the basic skill code won't have to change to make this happen, so
this additional sleep is adequate for today.

Also snuck in a minor change to a comment.
2017-11-22 13:21:23 -06:00
Matthew D. Scholefield 4c0ba6869e Add unit tests for messaging 2017-11-22 13:03:50 -06:00
Matthew D. Scholefield 0cf5c44f7c Add send_email method to skills 2017-11-22 13:03:50 -06:00
Åke 7ac43bd1e2
Merge pull request #1244 from MycroftAI/feature/mycroft-mic-listen
Add 'mycroft.mic.listen' messagebus command
2017-11-22 09:35:52 +01:00
penrods 6463b9a92d Add 'mycroft.mic.listen' messagebus command
Add support for 'mycroft.mic.listen' on the messagebus to trigger the system
to listen for STT processing.  This can be posted on the messagebus by outside
systems, such as a physical or GUI Listen button.
2017-11-21 22:45:12 -06:00
penrods 0b69b056e3 Add support for non-string keys, also
This handles the edge case of things like { 3 : "abc" }.
2017-11-21 11:34:04 -06:00
penrods 88ff31397b Fix dialog renderer
The recent change to remove Pystache introduced a bug in cases where
the passed-in key/value data included non-strings for the value.  This
showed up in the weather skill which passed in "lat" and "lon" as floats.
Now the value is explicitly converted using str().
2017-11-21 11:34:04 -06:00
Åke cb3de9affa
Merge pull request #1242 from MycroftAI/feature/viseme-sync
Improve mouth synchronization with speech
2017-11-21 13:02:05 +01:00
Åke Forslund 2c3e5c3885 Minor correction of mouth_visime docstring 2017-11-21 12:41:36 +01:00
penrods c1e1b935ee Improve mouth synchronization with speech
When the TTS engine provides visemes to the faceplate, the information
passed along consists of the mouth shape and the duration to display it.
When the system get backed-up for some reason (e.g. the CPU is briefly
overloaded), the code would attempt to catch up the animation but would
still send the 'expired' viseme across the serial port to the faceplate
with no wait-time.  This results in a fast-moving mouth to catch up,
which isn't very pleasing.

Now the viseme is passed along with an expiration date, so if the time
to display it has already passed then the viseme code gets thrown away
instead of being sent across the (relatively slow) serial port.  This
allows better catch-up.
2017-11-20 21:22:48 -06:00
Åke 421c37f572
Merge pull request #1226 from ahayworth/feature-replace-google-tts-with-cloud-speech
Add Google Cloud Speech API STT
2017-11-20 09:53:00 +01:00
Åke ed061df519
Merge pull request #1223 from MycroftAI/feature/improve-metrics-naming
Improve accuracy of metrics naming
2017-11-19 08:19:43 +01:00
Åke Forslund f23ba5197e Remove all mycroft packages individually
Autoremove don't seem to be reliable enough. This will remove the
required packages individually.
2017-11-19 00:24:48 -06:00
penrods 1d4c614a36 Enhance CLI and screen corruption fix
Several refinements:
* Remove the "What time is it" preloaded example
* Page up/down now moves by 1/2 the # visible log lines instead of always 10 lines
* Reduce the frequency of full-screen redraws to 10 secs instead of 5 (because less needed with the corruption fix)
* Add the version of mycroft-core in the upper-right corner
* FIX: screen redraw now uses a lock, preventing corruption from drawing simultaneously from multiple threads
2017-11-17 19:25:16 -06:00
Åke fd1fb1b527
Merge pull request #1235 from MycroftAI/bugfix/remove-pystache
Remove pystache
2017-11-17 09:25:57 +01:00
Matthew D. Scholefield b4226ff27b Remove pystache
On certain platforms it escapes quotes which causes problems. Since we only use it for something as simple as key value replacements, it doesn't make sense to include it as a dependency
2017-11-17 01:36:40 -06:00
Andrew Hayworth 6325c7ae7b Add replacment for Google TTS via Google Cloud Speech API
As noted on the Chromium Dev How-to [1] and on the
SpeechRecognition library docs [2], the Google TTS API
is really not the right API to call. While it's simple,
and allows you to authenticate via a simple token, it is
also limited to a max of *50* requests per day.

That's not a lot. I don't think many people will find that
useful, outside of quick testing (if they can even get an
API key - I couldn't figure out how to generate one that
worked correctly).

This commit introduces a new STT backend, google_cloud, so that
the Google STT backend can be deprecated eventually. To do so, we
needed to:
- Install the Google API Client Library
- Create a new STT class which knows how to turn a provided Google
  JSON credentials file into a string (the SpeechRecognition library
  expects you to pass in the JSON string, not a file path, nor an object).

Any person wishing to use this will need to:
- Enable the Cloud Speech API on the Google Cloud Platform console
- Create a new Service Account Key, and download the credentials to
  a secure location
- Configure that location in mycroft.conf, like so:

  "stt": {
    "google_cloud": {
      "credential" {
        "json": { contents of downloaded credentials }
      }
    }
  }

It's worth noting that the Cloud Speech API has a free quota of
60 minutes per month, which would probably stretch further than 50
individual requests. So for hobbyists, it should be nothing but
a net benefit.

[1] http://www.chromium.org/developers/how-tos/api-keys
[2] https://github.com/Uberi/speech_recognition/blob/master/reference/library-reference.rst#recognizer_instancerecognize_googleaudio_data-key--none-language--en-us-show_all--false
2017-11-15 22:10:00 -06:00
Matthew D. Scholefield 168a2b660f Improve accuracy of metrics naming
- md5 is consistent across architectures
 - Account ID is now consistent per user. Previously was using the device id
2017-11-15 19:35:53 -06:00
Åke f656373719
Merge pull request #1219 from MycroftAI/bugfix/enable-learn-typo
Fix typo when enabling learn
2017-11-12 15:28:58 +01:00
Matthew D. Scholefield 66540d9a9b Fix typo when enabling learn 2017-11-10 12:34:34 -06:00
devs-mycroft 4bf93486af Version bump from 0.9.5 to 0.9.6 2017-11-10 15:38:51 +00:00
Åke Forslund 1093dc0ef0 Handle missing messagebus in a correct way
==== Tech notes ====
The send script will throw an IOerror exception if the bus service isn't
started. This correctly catches it and emits a single warning.
2017-11-10 15:27:17 +01:00