Commit Graph

1947 Commits (60ab1aab69996ee756bd124abf19d5f3b4ff83db)

Author SHA1 Message Date
Åke 60ab1aab69 Fix registering fallback (#1974)
The wrong method was registered, instead of the wrapped function call
the original method was registered. This led to not being able to
unregister fallbacks.
2019-01-31 00:21:15 -06:00
Åke 9ef95506d0 GUI update number 6 (#1964)
* Add communication from GUI to skills

- "set" events from Qt will set/update a variable in the skills .gui member
- It's possible to add general event handlers using self.gui.register_handler()
- Moved registration of skill_id to just after skill init

* Ensure that simultaneously writes doesn't occur

Wrap WebSocketHandler.write_message() with a lock in an attempt to handle "buffererror: existing exports of data: object cannot be re-sized."

* Add better logging to help debug disconnect issue

* Allow overriding the idle page

SkillGUI.show_page() and SkillGUI.show_pages() now takes an optional
override_idle parameter. This is used as a hint by the mark-2 skill
and if possible the idle screen will not be shown.

* Improve debugging using Logger

* Raise exception when sending a non-existing gui page

* Restore running state to new connections

When a GUI is connected data and running namespaces are synchronised and
shown.

This refactors the code quite a bit moving the GUI state from the GUIConnection
object to the Enclosure.

The GUIConnection object does the handles the sync in the on_connection_open()
method.

* Add gui.page_interaction message

Currently triggered on page change on the display.

* Handle message when gui changes sessionData

* Check if socket exists on gui before sending data

* Increase port on each failure and retry
2019-01-22 08:45:19 -06:00
Chris Rogers 644d75cfc9 Issues-1962 - Revert changes to normalize_en 2019-01-21 18:37:04 -05:00
Åke 7fd59bf488
Merge pull request #1958 from alistair23/alistair/utf8-encoding
dialog: Open template file as utf8 encoded
2019-01-18 10:36:23 +01:00
Alistair Francis 71afcb9ce5 text_client.py: Don't log stack trace on missing conf (#1957)
If we are missing the ".mycroft_cli.conf" file we print a message to the
user informing them that we are ignoring the missing file along with a stack trace. The stack trace is really not necessary so this removes it.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-18 09:59:55 +01:00
Alistair Francis 4c140c3cfe dialog: Open template file as utf8 encoded
To avoid UnicodeDecodeError's when opening files tell Python that we
want to open the file as a utf8 encoded file.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-17 11:45:14 -08:00
devs-mycroft ce37c7861b Version bump from 18.8.10 to 18.8.11 2019-01-17 14:46:19 +00:00
Åke Forslund d5f04ada76 Run queries in threads 2019-01-17 12:00:37 +01:00
Åke Forslund f106f9603f Revert "Merge pull request #1889 from forslund/feature/threaded-emitter"
This reverts commit cb891ecf2f, reversing
changes made to 876b5393f7.
2019-01-17 11:11:43 +01:00
Steve Penrod b38668a2ef Fix Ctrl+C handling in CLI
Ctrl+C was not being properly handled by the CLI, resulting in an  unclean
shutdown and other unexpected consequences -- e.g. a
"./start-mycroft.sh debug" would kill the background processes on exit.  The
KeyboardException was never being triggered.

Now the SIGINT is being captured and Ctrl+C behaves (as intended) just like
pressing Ctrl+X.
2019-01-17 09:47:43 +01:00
Matthew D. Scholefield cb891ecf2f
Merge pull request #1889 from forslund/feature/threaded-emitter
Run emitter using threadpool
2019-01-16 10:37:38 -06:00
G3RB3N 876b5393f7 Dev add nl nl (#1906)
* Added nl-nl voc, dialogs and formatter
2019-01-16 13:48:41 +01:00
ludwhe 8b71b89cf8 Better feed back for missing intent/entity files 2019-01-14 08:56:35 +01:00
Åke Forslund 555031762a 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.
2019-01-14 07:29:43 +01:00
jarbasal 15141528bd vlc audio length check 2019-01-12 13:10:54 +01:00
jarbasal 1c3543f5e5 Support for audio seek
The audioservice can now jump forward and backward in the audio stream/file

The functionality is accessed via the audioservice class's seek_forward(),
seek_backward() and seek() methods
2019-01-12 13:10:54 +01:00
Åke 4e10339f55
Merge pull request #1912 from aleale99/dev
Updated:
- nice_date()
- pronounce_number()
2019-01-12 13:07:19 +01:00
Åke Forslund 38701a9790 Remove inheritance from object
Inheriting from object isn't necessary in python3.
2019-01-11 09:24:21 +01:00
Å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 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
Ale 8f0e6787f3
Update parse_it.py
correct import
2019-01-05 09:58:21 +01:00
Ale 4270fd4528
Update parse_it.py
imported too early, the functions that use them are not yet ready
2019-01-04 18:39:54 +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
Ale a6eff4c750
cleanup 2018-12-31 16:56:54 +01:00
Ale 3d3bccb3bb
Update parse_it.py isFractional_it with
with short_scale =False
2018-12-31 16:45:06 +01:00
Ale f8515fdf79
Update format_it
italian use short_scale=False
2018-12-31 16:34:17 +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
Å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
Ale 62afba6011
Update date_time.json
corrected: all test passed
the  year's RE section can be improved
2018-12-23 11:11:42 +01:00
Ale 404316fa70
Update date_time_test.json
now all tests are passed
2018-12-23 11:05:22 +01:00
Ale 4a9b82437b
Update date_time.json
correct typing error
2018-12-22 18:34:09 +01:00
Ale aa0c0434af
Update date_time.json
correct typing error
2018-12-22 18:22:32 +01:00
Ale 665e974ad9
Update date_time.json
correct type error line 31
2018-12-22 18:14:46 +01:00
Ale 5f49c15a4d
corrections in date_time.json
some correction in RE
2018-12-22 18:01:17 +01:00
Ale 498afbbc6f
Create date_time_test.json
translated but it's not clear how to test
2018-12-22 11:38:49 +01:00
Ale 0c5fa97e6a
Update date_time.json
in italian date_format is always {day} {month}, year
2018-12-22 11:35:04 +01:00
Ale 4b9c410dd4
Update format.py
update pronounce_number_it() to long/short scale and scientific format
2018-12-22 11:13:45 +01:00
Ale 5933d3b6d2
Update format_it.py
update pronounce_number_it() to long/short scale and scientific format
correct some unusuals numbers in  LONG_SCALE_IT
2018-12-22 11:10:34 +01:00
Ale a96ce1babf
Merge pull request #2 from MycroftAI/dev
Rebase 18.8.9
2018-12-22 10:46:36 +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 59a8770eaf
pep8 update format_it.py
just a space
2018-12-19 14:54:04 +01:00
Ale eff7c7e10c
minor update format_it.py
insert  LONG_SCALE_IT  and SHORT_SCALE_IT
2018-12-19 14:37:25 +01:00
Ale 34f937cdf7
create italian date_time.json
it still needs some attention in year_format and date_format
2018-12-19 11:38:23 +01:00