Commit graph

232 commits

Author SHA1 Message Date
Fabio Manganiello
5293f5b203 #73: Implemented wrapper plugin for the new Node.js mercury-parser.
As the Mercury reader web API is deprecated, and the only available
implementation is the open source mercury-parser, node, npm and
@postlight/mercury-parser have to be added as dependencies for the
http.webpage plugin (or at least for the `simplify` action).
2019-07-24 19:02:53 +02:00
Fabio Manganiello
ca030b06e0 Added support (not working yet) for custom Google device actions and events 2019-07-17 14:56:04 +02:00
Fabio Manganiello
bb3a39acb9 Better synchronization mechanism between push-to-talk and platypush when an event is matched and no assistant playback should follow up 2019-07-12 18:11:14 +02:00
Fabio Manganiello
6769707580 Stop assistant interaction if a phrase match is found 2019-07-12 09:37:37 +02:00
Fabio Manganiello
b63843a130 Fixed assistant event constructor with new Google plugins structure 2019-07-12 01:45:27 +02:00
Fabio Manganiello
5766367402 Rewritten snowboy and Google push-to-talk plugins to make them a better replacement for the deprecated google-assistant-library 2019-07-11 22:54:33 +02:00
Fabio Manganiello
24d3810e44 Added NFC backend 2019-07-09 01:44:31 +02:00
Fabio Manganiello
1eae45805d Added new sensors plugin to webpanel 2019-07-02 14:04:25 +02:00
Fabio Manganiello
277d6ec271 Added torrent support in new webplayer 2019-07-01 19:32:22 +02:00
Fabio Manganiello
482f6f0765 New media webplugin WIP 2019-06-22 00:15:32 +02:00
Fabio Manganiello
4cd2e6949f New media webplugin WIP 2019-06-21 02:13:14 +02:00
Fabio Manganiello
1ad86428c8 Added support for custom webhooks 2019-05-17 14:55:29 +00:00
Fabio Manganiello
710694e8d7 Added altitude to LatLongUpdateEvent 2019-03-18 00:17:11 +01:00
Fabio Manganiello
87d63d7cb3 Added Google Fit backend 2019-03-16 01:22:42 +01:00
Fabio Manganiello
84099b2ab7 Added support for multiple listeners on multiple servers and topics for general-purpose messaging on the MQTT backend 2019-03-07 22:52:02 +01:00
Fabio Manganiello
f6221a798a Don't add disable_logging to the string representation of the Response object unless it's set 2019-03-06 02:23:06 +01:00
Fabio Manganiello
0596d77403 Support for camera snapshot and stream endpoints and for disabling logging on response and event messages 2019-03-06 02:01:17 +01:00
Fabio Manganiello
29b8d0827b Added basic support for camera events in the camera plugin 2019-02-27 20:12:40 +01:00
Fabio Manganiello
0e794cd1b0 Refactored HTTP server to split the routes on separate files and keep the main Flask app object in a separate file as well so it can be easily wrapped by a WSGI instance 2019-02-23 21:19:00 +01:00
Fabio Manganiello
c4cd93a6da Added VLC plugin 2019-02-20 17:17:30 +01:00
Fabio Manganiello
2d2db499be Running recording in a separate thread so it doesn't block the receiving backend and added playback/recording start/pause/stop events 2019-02-15 19:23:01 +01:00
Fabio Manganiello
148d25f1cb Added mopidy backend functionalities 2019-02-12 20:34:17 +01:00
Fabio Manganiello
5cbd0fdfe7 Added support for VTT subtitles and subtitles toggling both in local and browser media players 2019-02-12 01:30:55 +01:00
Fabio Manganiello
34f0264d5e Subtitles support
- Added support for local and OpenSubtitles media subs
- Added management of media events in web panel
2019-02-11 00:55:20 +01:00
Fabio Manganiello
52d0ba442b Refactored webtorrent plugin and synchronization with the player
The WebTorrent plugin now uses the `download -o <download_dir> -p <port>` options.
Improved interaction both with the webtorrent executable and the player
executable, and triggering the right events upon state changes, as well
as free support for torrent streaming through the webtorrent executable.
2019-02-05 00:15:36 +01:00
Fabio Manganiello
286eb431f0 Refactored torrent module 2019-02-04 01:01:39 +01:00
Fabio Manganiello
d59044fa2d Added MPlayer plugin 2019-02-01 09:34:50 +01:00
Fabio Manganiello
339d1eb132 Better way to log the impacted plugin and action in case of uncaught exceptions in requests 2019-01-27 17:51:07 +01:00
Fabio Manganiello
2b38f1b03f Added alarm, timer and error event handlers on assistant backend 2019-01-19 01:55:32 +01:00
Fabio Manganiello
db4e68e247 Do exception logging at Request level and discard duplicate exception messages between retries 2019-01-13 20:09:25 +01:00
Fabio Manganiello
8ea0519954 Support for set/clear timeout/interval utils actions and error handling refactor
- Added set/cler timeout/interval actions in the utils plugin to
dynamically set or stop timed actions from your custom logic

- Actions error handling refactoring. If a Response is processed with
some errors, then just log the error and return it to the caller,
without raising an exception. If instead the action execution raised an
uncaught exception, then handle the retries properly and return errors
as a list with the output from all the retries, without being too
verbose with the returning and logging the whole stack trace multiple
times.
2019-01-13 19:29:08 +01:00
Fabio Manganiello
2a52eb770b Renamed value variable in expand_value_from_context to _value to prevent common name clashes with attributes named 'value' in the context 2019-01-12 22:43:01 +01:00
Fabio Manganiello
1087dae197 Added Adafruit IO backend 2019-01-12 01:07:38 +01:00
Fabio Manganiello
c1b05226a9 Made the mpd backend a bit more resiliant 2019-01-10 01:28:12 +01:00
Fabio Manganiello
d50d92e99e Added Philips Hue lights backend to monitor status changes to the lights 2019-01-09 09:21:48 +01:00
Fabio Manganiello
7aefe4e520 More resilient logic in case actions in a procedure return null responses 2019-01-07 00:07:45 +01:00
Fabio Manganiello
efad5a2bd7 Added Snapcast backend 2019-01-06 19:19:30 +01:00
Fabio Manganiello
8fe4d77e3d Made requests parsing more robust against messages with target not set (e.g. messages received over HTTP API) 2018-12-18 14:59:10 +01:00
Fabio Manganiello
791c36f5df More tolerance on json.loads() in case the parsed value from the request context is not a string 2018-12-03 23:04:23 +01:00
Fabio Manganiello
4a148971b4 Allow non-string values to be passed through a request context as well 2018-12-03 22:52:25 +01:00
Fabio Manganiello
66b6f0bc8b Added Wiimote support docs; Added Wiimote connection/disconnection events 2018-12-01 18:55:13 +01:00
Fabio Manganiello
2b03276159 #46: Added Wiimote support 2018-12-01 17:56:31 +01:00
Fabio Manganiello
76b40c0c37 Managing torrent stop and remove as well 2018-10-22 19:12:06 +02:00
Fabio Manganiello
9974583038 Added torrent plugin 2018-10-22 14:52:32 +00:00
Fabio Manganiello
68aaf9cd61 Message timestamp refactored 2018-10-08 13:30:00 +00:00
Fabio Manganiello
948f3dc37d Implemented timestamp mark on messages to trigger message expiration logic in case something stays on the bus for longer than a minute 2018-10-08 10:35:59 +00:00
Fabio Manganiello
13c1895295 Support for runtime arguments on procedures 2018-09-25 19:20:34 +02:00
Fabio Manganiello
a4f075a4c1 Added support for ApplicationStartedEvent and ApplicationStoppedEvent 2018-09-24 09:18:46 +00:00
Fabio Manganiello
6449504e26 Switched the bus to a Redis bus 2018-09-20 10:49:57 +00:00
Fabio Manganiello
98d24b061a Added joystick backend 2018-09-18 18:58:23 +02:00
Fabio Manganiello
d2bd49b364 Sync changes on playback volume or state with events and web UI 2018-08-18 01:11:14 +02:00
Fabio Manganiello
822e0a1e25 Better fix for broken async variables and attributes after Python 3.7 migration 2018-08-07 22:00:11 +00:00
Fabio Manganiello
ee5e4dff92 Revert "In Python 3.7 async is a strict language keyword that can't be used for variables names - replaces occurrences with _async"
This reverts commit f0577733b6.
2018-08-07 21:52:07 +00:00
Fabio Manganiello
b023618950 Revert "In Python 3.7 async is a strict language keyword that can't be used for variables names - replaces occurrences with _async"
This reverts commit e625861edf.
2018-08-07 21:52:02 +00:00
Fabio Manganiello
f0577733b6 In Python 3.7 async is a strict language keyword that can't be used for variables names - replaces occurrences with _async 2018-08-07 21:28:06 +00:00
Fabio Manganiello
e625861edf In Python 3.7 async is a strict language keyword that can't be used for variables names - replaces occurrences with _async 2018-08-07 21:26:57 +00:00
Fabio Manganiello
61e211ee07 Added Kafka plugin 2018-07-28 01:55:19 +02:00
Fabio Manganiello
3ab77e32f4 Doc fixes 2018-07-24 15:01:01 +00:00
Fabio Manganiello
b94ec36d0f Added documentation to events 2018-07-09 22:38:08 +02:00
Fabio Manganiello
66d78c8615 [#61] Plugins actions refactoring
- Using `@action` annotation to indicate methods that are allowed to be
executed as actions

- The output and errors of an action are automatically wrapped into a
`Response` object without any response build required on the plugin side
2018-07-06 02:08:38 +02:00
Fabio Manganiello
81a81312e3 Basic support for token authentication on request level 2018-07-05 09:15:53 +02:00
Fabio Manganiello
f73adc83bc - Support for assistant response text as a ResponseEvent
- Don't trigger a ConversationEndEvent if the assistant needs to follow up on the previous interaction
2018-06-20 19:21:32 +02:00
Fabio Manganiello
061b676fbc If the string assignment didn't work either, give up without failing (also in Request) 2018-06-14 19:12:16 +02:00
Fabio Manganiello
5a1e77c174 Added iframe modal on dashboard with support for dynamic events to temporarily/permanently display a custom web page on the connected browsers 2018-06-13 20:40:49 +02:00
Fabio Manganiello
0905981c58 Refactoring sensor backend and added SensorSerialBackend 2018-06-11 21:07:54 +02:00
Fabio Manganiello
f67b737a54 Best effort in context expansion 2018-06-07 09:33:26 +02:00
Fabio Manganiello
4da74b1096 Refactored logging submodule 2018-06-06 20:09:23 +02:00
Fabio Manganiello
c867a21104 If the value is a platypush Message, then converting it into a string would result in a JSON dumps that might break the interpreter (e.g. 'null' is a valid JSON keyword but it's not recognized by Python). Therefore first parse the variable from JSON 2018-06-06 18:50:09 +02:00
Fabio Manganiello
850a4f2146 A less convoluted and robust way to expand the context as variables 2018-06-06 17:14:44 +02:00
Fabio Manganiello
9984b75895 Added midi backend to support events from MIDI sources 2018-06-06 02:26:28 +02:00
Fabio Manganiello
c73905d35d More robust handling of card removed events 2018-05-27 11:47:57 +02:00
Fabio Manganiello
b04a355cc0 Pass also ATR and reader to SmartCardRemovedEvent 2018-05-27 11:25:29 +02:00
Fabio Manganiello
8a6dcdbf5f Generating SmartCardRemoveEvent as well when a scard is removed 2018-05-27 11:11:05 +02:00
Fabio Manganiello
755eb83093 Added support for smart card events 2018-05-27 10:47:58 +02:00
Fabio Manganiello
c1caa182be Handling assistant no_response events 2018-05-25 18:26:02 +02:00
Fabio Manganiello
4f75b765b1 Added assistant conversation timeout event 2018-05-25 18:18:16 +02:00
Fabio Manganiello
57722fce2a Added support for Leap Motion device events 2018-05-23 17:07:15 +02:00
Fabio Manganiello
9923742e74 Prevent plugins from breaking in case of concatenations with None elements 2018-05-14 19:06:11 +02:00
Fabio Manganiello
6c0dc9a4dc Added GMaps geocode plugin and geo update event 2018-05-13 21:42:26 +02:00
Fabio Manganiello
0252cc03c4 Added __init__.py 2018-05-06 00:12:57 +02:00
Fabio Manganiello
d83c2c903f - Added support for /dashboard page with customizable widgets under the web server
- Introduced Redis to pass messages between the Flask process and the
main application. It now syncs messages with the bus and connected websockets
- Added support to programmatically modify dashboard widgets through POST request like Dashing
- Added weather forecast plugin
2018-05-04 03:24:35 +02:00
Fabio Manganiello
bd8d4649c5 Added MCP3008 backend 2018-04-29 23:51:53 +02:00
Fabio Manganiello
34405b96f6 Removed unused mandatory parameters for VideoEvent constructor 2018-04-25 01:04:51 +02:00
Fabio Manganiello
53f8f88bac Added inotify files and paths monitoring backend 2018-04-23 16:32:35 +02:00
Fabio Manganiello
6ef97e9ddc Assign the recursive output of _thread_func to response to make sure that the latest response is always returned - that means the successful response in case the previous one was a failure 2018-04-22 21:26:53 +02:00
Fabio Manganiello
95b537dee4 s/music/video/ 2018-04-19 22:45:40 +02:00
Fabio Manganiello
2fdb8c50da Added support for video events 2018-04-19 22:42:28 +02:00
Fabio Manganiello
87fb8855b7 - Show Spotify results first from MPD search, if available
- More granular calculation of the match score
2018-04-15 11:15:43 +02:00
Fabio Manganiello
73c74654d1 - Better MPD filter management - you can now pass filters as arrays like
['artist', 'Led Zeppelin', 'title', 'Stairway To Heaven'] instead of
relying on one single type-filter pair

- Improved condition matching - don't skip the last condition token if
there are still event tokens to add
2018-04-14 23:58:48 +02:00
Fabio Manganiello
8ae22726ed Added serial device backend 2018-04-07 03:08:52 +02:00
Fabio Manganiello
2be2677963 Added light sensor backend 2018-04-06 17:19:08 +02:00
Fabio Manganiello
a14d6fe652 - Stop assistant playback only if there was a user request. This
prevents a PortAudio write on input-only stream error in the Assistant
SDK, see https://github.com/googlesamples/assistant-sdk-python/issues/185

- Make sure that user_request is always defined before returning it

- Use assistant.google.pushtotalk as a fallback if assistant.google is
not configured/available
2018-03-21 23:21:41 +01:00
Fabio Manganiello
d5f73023ea Support for custom hotword detection through Snowboy 2018-03-20 23:34:36 +01:00
Fabio Manganiello
8b733fb859 - Added IR sensor backend
- Fixed default power offsets
- Changed threshold distance for ultrasound sensor
- Fixed power multiplier coefficient
2018-03-04 17:55:48 +01:00
Fabio Manganiello
1cab75757b - Support for playlist update events handling on MPD
- Support for playlist updates on the web interface
- Support for selecting and playing tracks in the web interface
2018-02-05 00:55:19 +01:00
Fabio Manganiello
55eb689121 Support for RSS digest generation either in HTML or PDF format 2018-01-28 02:01:54 +01:00
Fabio Manganiello
14afbcad3a Support for RSS feeds update events, solves #48 2018-01-27 04:32:44 +01:00
Fabio Manganiello
834b700d5f Added GMail actions support, solves #49 2018-01-17 03:16:59 +01:00
Fabio Manganiello
14b511034f Support for cron actions, solves #47 2018-01-15 22:37:01 +01:00
Fabio Manganiello
f6d16366eb Changed assistant stop_conv logic on match 2018-01-15 13:37:48 +01:00
Fabio Manganiello
4fa7a08006 Added mpd backend 2018-01-13 02:52:06 +01:00
Fabio Manganiello
b1f42c22ae Added Booking.com endpoints automation 2018-01-11 19:31:44 +01:00
Fabio Manganiello
959296b15a Support for context variables and constants 2018-01-10 18:47:25 +01:00
Fabio Manganiello
19cfafb2c7 Making the HTTP poll events work 2018-01-10 03:14:27 +01:00
Fabio Manganiello
d4ef2bf59e Implemented for loops support in procedures, #44 2018-01-08 02:41:24 +01:00
Fabio Manganiello
252f503e4d Better management of the context and support for proper expression expansion from the context in the action execution through eval 2018-01-07 23:31:19 +01:00
Fabio Manganiello
694d7ca62d Support for PushBullet events on notifications, #36 2018-01-07 00:58:03 +01:00
Fabio Manganiello
dfee3f5004 Recursively expand the context of a request over the nested arguments 2018-01-06 12:40:22 +01:00
Fabio Manganiello
f83aedf0f1 Support for synchronous and asynchronous procedures 2018-01-06 00:21:25 +01:00
Fabio Manganiello
b98fe01352 Implemented sequential execution of tasks in procedures, response context parsing and procedure response returned on the bus as well, #37 2018-01-05 23:20:39 +01:00
Fabio Manganiello
109805fd8d Don't stop the conversation on hook match if the hook match was a priority one 2018-01-05 10:09:02 +01:00
Fabio Manganiello
a476de81a8 Fixed procedure execution code 2018-01-04 16:11:54 +01:00
Fabio Manganiello
20b07fb02f Made an HTTP backend, #27 2018-01-04 02:45:23 +01:00
Fabio Manganiello
f2e5ba1eef Fixed corner case on event match in case the named argument is the last token 2018-01-02 01:37:30 +01:00
Fabio Manganiello
760782f427 Added new files 2018-01-02 00:48:41 +01:00
Fabio Manganiello
5a92c0ac3b - Proper support for event arguments
- Better algorithm for event matching
- Added send_event support to pusher
2018-01-02 00:35:55 +01:00
Fabio Manganiello
92b691041e Added more general media control plugin, #10 2017-12-27 10:19:35 +01:00
Fabio Manganiello
617c0f8a07 Added code for handling procedures - solves #1 2017-12-25 17:23:12 +01:00
Fabio Manganiello
6928e440bc Support for Flic button events 2017-12-24 13:15:37 +01:00
Fabio Manganiello
18830232a4 Don't trigger the default Assistant response if the phrase matched an internal rule. Also, backends should be easily accessible through a context module (more context variables will be added there) 2017-12-24 02:35:49 +01:00
Fabio Manganiello
7b97a5b229 - #30 Implemented Google Assistant backend
- #21 Implemented events management
2017-12-24 01:10:48 +01:00
Fabio Manganiello
f04d0bd24f Don't send responses in case of errors within the retry mechanism 2017-12-22 18:09:11 +01:00
Fabio Manganiello
ac3dad5fd9 Changed design for run_request - it should be a method of Request, not a member of Daemon 2017-12-22 18:04:18 +01:00
Fabio Manganiello
4b819d5460 Another major refactoring. Among the other things, reintroduced local backend, made requests and responses working in every case, and properly handling stop events 2017-12-22 00:49:03 +01:00
Fabio Manganiello
bd5c80175f - Major refactoring.
- More consistent naming for many methods, plus added a more extensive doc.

- Refactored the entry points for the daemon and the pusher into two
  classes, easier to encapsulate and wrap into tests.

- Removed the local backend - managing the concurrency of two processes
  reading and writing on the same socket at the same time was too much,
  and its utility outside of the tests (which can have mock backends as
  well) is quite modest.

- Managing stop events on the bus. Still some work to do tho.

- Fixed several bugs.
2017-12-20 20:25:08 +01:00
Fabio Manganiello
21381e7c0f [#23] Request/Response ID chaining fixes
[#17] Response wait and response timeout implementation on pusher side
2017-12-18 22:40:56 +01:00
Fabio Manganiello
18a5902ac4 Locking requests and responses with ids 2017-12-18 03:09:38 +01:00
Fabio Manganiello
4a04e51da7 Major refactoring #2 2017-12-18 01:10:51 +01:00
Fabio Manganiello
1a6d726b19 Passing arguments to the plugin 2017-12-17 16:41:52 +01:00
Fabio Manganiello
339e7b73a5 Major refactoring.
Solves, among the others, #2, #18 and #22
2017-12-17 16:15:44 +01:00
Fabio Manganiello
dfb4620e0a Added __init__.py 2017-12-13 04:24:59 +01:00
Fabio Manganiello
33c4d9fb52 s/platypush.response/platypush.message.response/g 2017-12-13 04:21:26 +01:00