Commit Graph

2934 Commits (fa5c9abd78fd7be2d15c886a3b026796438786c1)

Author SHA1 Message Date
Åke fa5c9abd78 GUI Cleanup (#1939)
* Try to improve stability

- Remove sync_active
- Update the way variables are sent to the gui

* Do not show full path for pages

The cli now shows the basename of the current page to make it easier to
determine if the correct page is displayed.

* Make elements in loaded list named tuples

This makes the intent of the code a bit cleaner.
2019-01-09 20:09:21 -06:00
Åke 74ae24ec7e
Merge pull request #1936 from MycroftAI/feature/select-mic-by-name
Support selecting microphone by name
2019-01-08 08:49:48 +01:00
Åke Forslund ff04af99c9 Move the device finding code into an util function 2019-01-08 08:05:07 +01:00
Steve Penrod 2557637591 Support selecting microphone by name
Normally Mycroft will use the default PortAudio input device as the
microphone input for the user.  However in some cases there is reason
to specify a different input.

The "device_index" under the "listener" section in mycroft.conf has
always allowed a user to select the microphone explicitly.  But on
some systems the indices can change from reboot to reboot.  So this
adds the "device_name" setting.  If it exists (and the "device_index"
has not been specified explicitly), a regex match will be run against
the PortAudio device names.

When "device_name" is used, the voice.log will contain a listing of
the devices as they are tested.  This can be used to debug if a
name isn't matching as expected.

EXAMPLES:
/etc/mycroft/mycroft.conf
```
{
    "listener": {
        "device_name": "aawsrc"
    }
}
```
Would find a match against "aawsrc" or "aawsrcplug".  To force a specific
match, you can use a regex such as "aawsrc$".

/etc/mycroft/mycroft.conf
```
{
    "listener": {
        "device_index": 2
    }
}
```
The PortAudio device index specified will be used.

Names and indexes for PortAudio are difficult to guess.  The simplest way to
view them is either enter a value for "device_name" and look at the names
which appear in the log when starting Mycroft, or to run a simple program
such as:
```python
import pyaudio

pa = pyaudio.PyAudio()
for i in range(pa.get_device_count()):
    dev = pa.get_device_info_by_index(i)
    print((i, dev['name'], dev['maxInputChannels']))
```
2019-01-08 07:51:41 +01:00
Åke e08075dd61
Merge pull request #1933 from MycroftAI/cve/remove-pyyaml
Remove pyyaml as a dependency
2019-01-07 17:30:04 +01:00
Kathy Reid aa05f5540f Remove pyyaml as a dependency
==== Fixed Issues ====
CVE-2017-18342
https://nvd.nist.gov/vuln/detail/CVE-2017-18342
high severity
Vulnerable versions: < 4.2b1
Patched version: 4.2b1
In PyYAML before 4.1, the yaml.load() API could execute arbitrary code.
In other words, yaml.safe_load is not used.

====  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.
2019-01-08 02:49:52 +11:00
Matthew D. Scholefield dcbda23482
Merge pull request #1930 from forslund/feature/dev-setup-pip
dev_setup: Exit if pip installation fails.
2019-01-03 15:56:08 -06:00
Åke Forslund e24b898d09 Exit setup if pip installation fails. 2019-01-03 19:25:59 +01:00
devs-mycroft 615fa648f9 Version bump from 18.8.9 to 18.8.10 2019-01-03 09:59:16 +00:00
Åke c92f92de4f Bugfix/mimic2 negative numbers (#1927)
* Fix mimic2 negative numbers

Make the regex extracting numbers also match negative numbers when preparsing phrases sent to the mimic2 service

* Update pronounce_number to use "minus" for negatives

After discussion in the chat it was suggested to use "minus" for negatives as default.

When scientific notation is used the term "negative " is still used.
2019-01-02 16:36:04 -06:00
Steve Penrod 8fe127bd5d Improve setup and start-mycroft scripts (#1924)
Improved the dev_setup.sh in several ways:
* Add 'wizard' that walks new users through setup
  - Option to put the mycroft-core/bin folder in the path
  - Option to change to 'master' instead of 'dev' branch.  This is
    usually desirable for users who only run Mycroft, not developers.
  - Option to auto-update when running Mycroft
  - Add soft link <mycroft-core>/skills to the /opt/mycroft/skills
    directory

Improve the start-mycroft.sh script
* Unify some duplicated code under init-once() function
* Add support for "auto-update", which attempts a git pull at startup
* Add require-process() function which doesn't restart already
  running services
* Add require-process for messagebus and skills services when running
  the CLI
* Tweak the --help message
2018-12-31 14:05:09 +01:00
Åke 2e9d764d36 GUI update (#1922)
Several additions to the GUI protocol support

These changes allow switching between pages successfully with the current
mycroft-gui widget:
* Optimized commands to handle the active skill list
* MycroftSkill.gui.show_pages(list, idx) allows multiple-pages to be displayed
  at a time starting with the given index visible.
* Merge SkillGUI.show_page with show_pages
  This limits code duplication and makes things a bit more maintainable.
* Do not reload on changed .qmlc files
* Make EnclosureGeneric derive from Enclosure
* Update show function to match mycroft-gui-app
  - adds internal representation of all loaded skills
  - uses new commands to switch between pages and namespaces
* Add Extra debug output in enclosure
  - Log if starting websocket fails
  - Log the sending of page info in more detail
* Update GUI Debug client in CLI
  - The CLI GUI now handles the new messages for switching pages
  - Handle different data types better by using format instead of string concatenation
* Disable syncing code.
  The sync code at startup outdated and needs to be reworked. Disabling it for now
  to allow better interaction.
* Minor cleanups
  - do not inherit from object
  - use format instead of string concatenations
  - remove duplicated self.loaded
  - correct private member access
* Refactor GUIConnection.show()
   Move the actions into separate methods for better overview of the logic
* Flipped "valid_file" to become "ignored_file"
2018-12-29 21:35:48 -06:00
Åke b194b51bcf
Merge pull request #1920 from MycroftAI/feature/barge-in
Add basic barge-in functionality
2018-12-29 08:40:30 +01:00
Åke fa56e91b00 Minor update to dialog (#1911)
* Do not load blank lines as dialogs.

* Simplify render code slightly using random.choice

* Remove import of io's open, not needed in python 3
2018-12-28 19:48:22 -06:00
Steve Penrod 1427992c99 Add basic barge-in functionality
The ability to "barge-in" has been lacking from Mycroft Core.  The Mark 1
microphone was unable to support this due to physical limitations, but the
Mark II and other implementations with more advanced mic tech which can
hear over themselves are able to continuously listen.

To enable this while retaining backwards compatibility with simpler mic.py
systems, there are now two mycroft.conf values:

{
   "listener": {
        "mute_during_output" : true,
        "duck_while_listening" : 0.3
   }
}

The above values are defaults, and implementers will likely override them
using the /etc/mycroft/mycroft.conf file when appropriate.

The duck_while_listening setting is currently handled in Mycroft's
skill-volume.  The mute_during_output is handled within mycroft-core itself.
2018-12-28 18:12:42 -06:00
Matthew D. Scholefield 531c5e51c1
Merge pull request #1919 from MycroftAI/yaml-doc-backend
Adding swagger yaml file for the API calls that mycroft core does
2018-12-28 12:00:10 -06:00
Matheus Lima 0fea0df513 Adding swagger yaml file for the API calls that mycroft core does 2018-12-28 14:35:21 -03:00
Matthew D. Scholefield 406a12b492
Merge pull request #1905 from forslund/feature/travis-py3.7
Add python 3.7 python version to travis tests
2018-12-28 10:49:33 -06:00
Åke ba81fb91f7
Merge pull request #1918 from MycroftAI/feature/setup-skip-mimic
Add option to skip mimic build in dev_setup.sh
2018-12-27 20:48:28 +01:00
Steve Penrod d39d049af0 Add option to skip mimic build in dev_setup.sh
Add a -sm "Skip mimic" option to dev_setup.sh which
will always prevent the download and complile of
the original Mimic.  By default, we still want to
do this all the time, but there are situations where
it is convenient to skip this time-consuming step.
2018-12-27 20:33:09 +01:00
Åke 33c735a935 Handle floats when checking year pronounciation (#1916)
* Handle floats when checking year pronounciation

* Corrected typo in docstring
2018-12-27 11:39:44 -06:00
Åke 630c853f25 Store config in more human readable form (#1915) 2018-12-26 11:55:45 -06:00
Thomas Castleman 29063df83c bugfix/issue-1913 fixed bug with new flag (#1914)
* bugfix/issue-1913 fixed bug with new flag

- `--no-error` can be used to disable exit-on-error behaviour
- improved print out in function show_help() to take a little less time and take up a little less space by using only one `echo` command, should work the exact same otherwise.
2018-12-26 10:47:07 +01:00
devs-mycroft 78bfcab8b9 Version bump from 18.8.8 to 18.8.9 2018-12-20 14:06:07 +00:00
Matthew D. Scholefield d95071070f
Merge pull request #1909 from forslund/bugfix/shutdown-precise
Stop hotword engines when reloading
2018-12-19 19:02:33 -06:00
Ale c8cfada9c6 Italian minor update in res/text/it-it/ (#1910)
Italian: minor update
2018-12-17 19:19:00 +01:00
Åke Forslund 3175baa2eb Stop hotword engines during reload
- Add overridable stop() method to HotwordEngine Class
- Add stop implementation to precise shutting down the runner
- Call wakeword_recognizer.stop() before reloading the listener configuration
2018-12-07 13:28:47 +01:00
devs-mycroft e22938cb68 Version bump from 18.8.7 to 18.8.8 2018-12-07 01:55:26 +00:00
Åke aebb9122f4
Merge pull request #1907 from forslund/bugfix/msm-0.6.3
Bump msm to 0.6.3
2018-12-07 00:41:08 +01:00
Åke Forslund a379c217eb Bump msm to 0.6.3
This fixes a potential issue where the startup processess halting when starting without internet connection.
2018-12-07 00:29:36 +01:00
Åke Forslund 1d7eabd0dd Add python 3.7 python version to travis tests
- Switch to Xenial so python 3.7 is available
- Install and use gcc-4.8 to make the mimic build faster
2018-12-06 17:17:36 +01:00
devs-mycroft 91fe3b79f8 Version bump from 18.8.6 to 18.8.7 2018-12-06 14:13:45 +00:00
Åke d53cff746a
Merge pull request #1903 from forslund/bugfix/log-config
Handle invalid json when loading log level
2018-12-06 10:40:37 +01:00
Åke Forslund 178319aa68 Handle invalid json when loading log level
Just ignore invalid log files
2018-12-05 22:32:23 +01:00
Åke cb5b9e85bf Handle failing refresh tokens (#1894)
Catch the HTTPError caused by the server returning a 401 status code when an expired refresh code is used to refresh the token.
2018-12-05 14:41:06 -06:00
Michael Nguyen 3bb15bc3c8
Merge pull request #1900 from forslund/feature/common-qa
Common query framework
2018-12-05 14:13:01 -06:00
Åke 74c1ee1678
Merge pull request #1890 from forslund/bugfix/gtts-version-update
Update gtts modules to fix google tts
2018-12-05 20:55:48 +01:00
Åke a7665dce10
Merge pull request #1902 from forslund/bugfix/extra-except
Enclosure mark-1: Remove extra except.
2018-12-05 18:16:12 +01:00
Åke edccf75f03
Merge pull request #1901 from forslund/feature/upgrade-padaos
Update padaos to better handle bad translations
2018-12-05 16:02:16 +01:00
Åke Forslund f95ff0a2f3 Remove extra except.
except except Exception -> except Exception
2018-12-05 12:36:53 +01:00
Åke Forslund 398d254ff1 Update padaos to better handle bad translations
This fixes cases where the translators have made a mistake and for
example omitted or added an extra parentheses
2018-12-05 12:28:44 +01:00
Åke 60462d8979
Merge pull request #1899 from MycroftAI/feature/gui
First pass at the GUI infrastructure
2018-12-05 09:23:08 +01:00
Steve Penrod 1e5ff1392f Feedback from code review
Several small changes based on the code review feedback:
* Drop '_' from classes like Enclosure_Mark1
* Adopt Python 3 style for class definitions and don't explicitly list '(object)'
* Slightly better documentation
* Moved MycroftSkill.show_html() to SkillGUI, resulting in code like self.gui.show_page('Weather.qml')
* Renamed SkillGUI.__dict to SkillGUI.__session_data.  This better reflects the
  how values are accessed in the QML.
2018-12-05 01:40:43 -06:00
Åke Forslund 70655bd9b6 Handle missing "enclosure" section in system config
Default to empty dict instead of None if the "enclosure" section is missing
2018-12-05 07:53:35 +01:00
Åke Forslund 7036c19bfc Add posibility to give bonus for visual skills
CQSVisualMatchLevel can be returned and if the device is a mark-2 a bonus will be given to the skill.
2018-12-04 23:47:52 +01:00
Åke Forslund 5b168c753b Add CommonQuerySkill class
Adds support for negotiating best answer for a questions

Currently three levels of confidence are defined

EXACT: If the query could be identified exactly and a response is returned.
    Example: The cockail skill could find a cocktail in the query that exists in
             it's database.

CATEGORY: A category of questions the skill handles could be identified.
    Example: The wiki-data skill can identify that the question is regarding
             A date of birth and finds an answer.

GENERAL: A general question and answer service could parse the question.
    Example: The wolfram alpha skill got a match for "How tall is Abraham
             Lincoln".
2018-12-04 22:58:25 +01:00
Åke 375becd6b4
Merge pull request #1893 from danielwine/feature/add-hungarian-language
Feature/add hungarian language
2018-12-04 15:25:22 +01:00
danielwine 7ec96b0d07 Add format_hu and update format.py along with tests 2018-12-04 15:09:20 +01:00
Steve Penrod 07bd6ef7af Code cleanup
Fixing PEP8 and such before merging into 'dev' branch.
2018-12-03 17:33:26 -06:00
danielwine 373e9f884f Add Hungarian dialog files 2018-12-01 20:38:43 +01:00