Commit graph

529 commits

Author SHA1 Message Date
Fabio Manganiello
af97f7b6a5 Tentative fix for Google Fit data points timestamp tracking 2019-03-18 11:58:40 +00:00
Fabio Manganiello
9d36688a61 Don't fail hard if it's not possible yet to retrieve the mopidy status in the backend constructor 2019-03-17 02:06:56 +01:00
Fabio Manganiello
a1c31a9fb9 Better handling for last_timestamp reads from Google Fit backend 2019-03-17 00:31:32 +01:00
Fabio Manganiello
9153b1e9c4 Added __init__.py init backend.google 2019-03-16 19:36:46 +01:00
Fabio Manganiello
f201f039e9 Extended and normalized key names in GoogleFitEvent type 2019-03-16 19:28:47 +01:00
Fabio Manganiello
87d63d7cb3 Added Google Fit backend 2019-03-16 01:22:42 +01:00
Fabio Manganiello
022262eb78 Handle MQTT listeners by host with lists of topics, so we only need one listener thread per host 2019-03-07 23:03:12 +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
38ebe87220 Get the device_id after initializing/creating the device 2019-03-07 20:11:32 +01:00
Fabio Manganiello
9324ad3f9b Create a device if it doesn't exist 2019-03-07 20:05:40 +01:00
Fabio Manganiello
fb93aec3ec Added empty __init__.py to plugins to let importlib correctly find the submodules 2019-03-06 02:21:26 +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
619c750f3b Don't fail hard if status is not available 2019-03-03 12:42:31 +01:00
Fabio Manganiello
a9fb6a38dd New API for firing events and registering/unregistering event handlers
both for plugins and backends
2019-02-28 01:21:25 +01:00
Fabio Manganiello
811af1bf9d Removed conflict leftovers 2019-02-26 23:55:00 +01:00
Fabio Manganiello
17367f5b3e Added camera plugin over cv2 2019-02-26 23:50:48 +01:00
Fabio Manganiello
150d95d0dc Support for launching uWSGI directly from the HTTP backend 2019-02-25 10:52:48 +01:00
Fabio Manganiello
0104037ada Dashboard background image added to static/resources 2019-02-24 20:10:58 +01:00
Fabio Manganiello
2adab13d50 Added favicon 2019-02-24 19:59:08 +01:00
Fabio Manganiello
8ef3aafb52 Added missing doc line in backend.http 2019-02-24 15:53:01 +01:00
Fabio Manganiello
8153d8476f Added uWSGI optional dependency for HTTP backend 2019-02-24 12:35:26 +01:00
Fabio Manganiello
e3fcebe4b6 Made a separate uWSGI startup script for the webapp 2019-02-24 00:17:31 +01:00
Fabio Manganiello
c74b939660 Renamed app->application for the main Flask webapp to make sure that the default uwsgi configuration can pick it up 2019-02-24 00:11:35 +01:00
Fabio Manganiello
d5c31d938b Run each message handling logic on the bus on a separate thread to make sure that messages don't queue up too much 2019-02-23 23:58:43 +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
73383ab80f Panel and modal close bindings should refer the target element in the event, not $(this) 2019-02-21 20:13:31 +01:00
Fabio Manganiello
6e1b6686c2 Revert "Running Flask webserver in another thread instead than another process"
This reverts commit 0a5c42fdfd.
2019-02-21 16:15:06 +01:00
Fabio Manganiello
0a5c42fdfd Running Flask webserver in another thread instead than another process 2019-02-21 14:33:41 +01:00
Fabio Manganiello
97e1dfacdf Made VLC template symlink 2019-02-21 01:38:21 +01:00
Fabio Manganiello
fd18bd84ca Don't download subtitles for magnet links (until the media file/metadata is ready at least) 2019-02-19 10:37:29 +01:00
Fabio Manganiello
151e2e56d9 typo 2019-02-19 01:05:44 +01:00
Fabio Manganiello
11af83f88f Added symlink media.mpv.html -> media.html 2019-02-19 00:19:48 +01:00
Fabio Manganiello
a21a11d499 Only proceed with subtitles loading when the list of subs is not empty 2019-02-17 16:29:39 +01:00
Fabio Manganiello
7d1c9275f5 Make it 10 seconds when it comes to poll time 2019-02-16 20:21:04 +01:00
Fabio Manganiello
55f1a33d90 Keep a sleep between polls to the Snapcast servers 2019-02-16 20:17:15 +01:00
Fabio Manganiello
6ac62b0161 Reset the time-seek indicator also on the web panel 2019-02-13 18:01:56 +01:00
Fabio Manganiello
4503eb31ed Clear track elapsed time display on stop event 2019-02-13 17:53:57 +01:00
Fabio Manganiello
a287a10bcc Propagate a MusicStopEvent upon playback stop even when the context of the current track is not available 2019-02-13 17:38:58 +01:00
Fabio Manganiello
7c817ba0c6 Position is expressed in milliseconds on mopidy websocket, convert to seconds 2019-02-13 17:25:56 +01:00
Fabio Manganiello
0a81b43f1d startStreaming should always return a map 2019-02-13 10:15:18 +01:00
Fabio Manganiello
09f5c92541 Passing url from the promise in the right way 2019-02-13 09:38:40 +01:00
Fabio Manganiello
34e2dffe99 Catching music stop events both on track_playback_ended and playback_state_changed 2019-02-13 00:58:40 +01:00
Fabio Manganiello
8a9c868f77 Bringing more consistency in music.mpd.js regardless of the backend 2019-02-13 00:50:58 +01:00
Fabio Manganiello
0697598a86 Fixed music.js widget as well for the new mopidy backend 2019-02-13 00:32:14 +01:00
Fabio Manganiello
3190d3c6c8 Fixing music.mpd.js both for mpd and mopidy backends 2019-02-13 00:27:36 +01:00
Fabio Manganiello
f0f6d43990 Using the right naming for length and elapsed variables 2019-02-12 23:59:13 +01:00
Fabio Manganiello
71c6ba2d34 More compatibility between TCP-based mpd and websocket-based mopidy backends when it comes to how the track time is reported 2019-02-12 23:48:18 +01:00
Fabio Manganiello
77a76370a5 Returning flat representation for artist and renamed 'name' attribute for consistency with the mpd backend 2019-02-12 23:24:16 +01:00
Fabio Manganiello
1c4edf93bf Another typo 2019-02-12 23:19:36 +01:00
Fabio Manganiello
97855b1535 state might not always be provided in a music event 2019-02-12 23:11:37 +01:00
Fabio Manganiello
18d2c51b4e Forgot an enumerate 2019-02-12 23:08:48 +01:00
Fabio Manganiello
e5c169a549 on_message requires two arguments 2019-02-12 23:00:16 +01:00
Fabio Manganiello
6024eddd2d on_open requires ws as a parameter 2019-02-12 22:58:22 +01:00
Fabio Manganiello
c18515bd3c Few more fixes on mopidy backend 2019-02-12 22:57:09 +01:00
Fabio Manganiello
ee3df8fe8c Switched mopidy backend from websockets to websocket-client 2019-02-12 22:52:29 +01:00
Fabio Manganiello
b555777cc8 Use another event loop for the synchronous websocket communication method 2019-02-12 20:49:10 +01:00
Fabio Manganiello
73d7e9a3ef Fixes on mopidy backend 2019-02-12 20:45:40 +01:00
Fabio Manganiello
148d25f1cb Added mopidy backend functionalities 2019-02-12 20:34:17 +01:00
Fabio Manganiello
7b99842225 Added draft for mopidy backend over websocket 2019-02-12 17:29:24 +01:00
Fabio Manganiello
f68efc0d68 Attempt to support subtitles on Chromecast media too 2019-02-12 11:13:19 +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
41c34b4bc5 Attempt to support subtitle tracks in web player 2019-02-11 18:46:25 +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
630850ee9a Reset the connection to a Snapcast server if it starts failing 2019-02-10 11:08:04 +01:00
Fabio Manganiello
cd49f22d5c Introduced floating panel with options on element click instead of the double-click-to-play logic on media elements 2019-02-09 01:53:17 +01:00
Fabio Manganiello
e2b0bf8462 More consistent management of media devices icons and added devices refresh button 2019-02-08 19:48:18 +01:00
Fabio Manganiello
b3f2974c4c Support for streaming media to browser 2019-02-08 00:43:43 +01:00
Fabio Manganiello
9ec3365413 Support for media streaming over internal HTTP server
Dropped the additional node.js dependency of localstream and relied
instead on a built-in solution to stream files
2019-02-07 14:27:14 +01:00
Fabio Manganiello
d15b21ddfa Added support for remote cast on the web media panel 2019-02-06 09:47:00 +01:00
Fabio Manganiello
d297b5cc42 Trying to make a more resiliant assistant error handling 2019-02-05 11:59:04 +01:00
Fabio Manganiello
caa48ad056 Better error handling on the assistant 2019-02-05 11:26:03 +01:00
Fabio Manganiello
63b423cf75 Refactored mplayer and omxplayer under the same media player 2019-02-02 00:06:28 +01:00
Fabio Manganiello
2d6dfc86ac typo 2019-01-30 10:04:42 +01:00
Fabio Manganiello
2956a9ca63 Restart the assistant connection on error 2019-01-30 09:21:35 +01:00
Fabio Manganiello
7a80cd08ce Handling dashboards widget configuration as a list instead of a hash to preserve the order of the widgets 2019-01-28 23:14:12 +01:00
Fabio Manganiello
e1920700ec Handle backend stop/disconnection on MQTT 2019-01-18 04:10:27 +01:00
Fabio Manganiello
122978c6f0 Support for extra args/kwargs passed to light.hue actions 2019-01-19 23:23:58 +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
03bdf5c547 Implemented get_timeout/get_timeouts/get_interval/get_intervals util methods 2019-01-14 20:44:40 +01:00
Fabio Manganiello
f38b2db273 Fixed interaction with modal dialogs to prevent browser race conditions when touchscreen events are involved 2019-01-13 23:45:03 +01:00
Fabio Manganiello
2d8b2ba55a Removed pp- prefix from the name of the spawned processes and threads 2019-01-13 20:41:15 +01:00
Fabio Manganiello
3587fa7cb4 Force music.mpd plugin reload when the mpd backend fails to get the state 2019-01-12 02:15:24 +01:00
Fabio Manganiello
78d44364cf Casting data to number whenever possible on FeedUpdateEvent as well 2019-01-12 01:58:35 +01:00
Fabio Manganiello
ca855fce5d Improved Adafruit IO data handling 2019-01-12 01:38:17 +01:00
Fabio Manganiello
1087dae197 Added Adafruit IO backend 2019-01-12 01:07:38 +01:00
Fabio Manganiello
fbf3600e91 Setting thread and process names properly through prctl 2019-01-10 23:45:13 +01:00
Fabio Manganiello
56c7258c74 Setting names for threads 2019-01-10 23:08:29 +01:00
Fabio Manganiello
0bbfaf4498 If the mpd frontend receives an empty PlaylistChangeEvent, trigger an initPlaylist to update the playlist 2019-01-10 22:27:44 +01:00
Fabio Manganiello
a349b45ba4 Removed get_plugin utils method from web server, it messes up with also with the reentrant locks as it runs in another process. Refactored Snapcast frontend to get the backend hosts asynchronously through a plugin method 2019-01-10 11:52:39 +01:00
Fabio Manganiello
c1b05226a9 Made the mpd backend a bit more resiliant 2019-01-10 01:28:12 +01:00
Fabio Manganiello
6150e07fc9 Prevent toggle button id clash because of Snapcast using the MAC address of a device as a client (and therefore the same client connected to multiple servers may lead to inconsistent behaviour) 2019-01-10 00:29:22 +01:00
Fabio Manganiello
89ea4798bf Restored retry logic in mpd backend 2019-01-09 22:20:01 +01:00
Fabio Manganiello
156e2e8b5a Don't go crazy with plugin reload logic in the mpd backend in case of corrupted received messages 2019-01-09 22:05:53 +01:00
Fabio Manganiello
464f84805f Added empty __init__.py to lib module 2019-01-09 15:13:10 +01:00
Fabio Manganiello
43ff0d4e25 Added hooks on light.hue web panel tab to synchronize light statuses with LightStatusChangeEvent events 2019-01-09 15:08:16 +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
9ba7a68578 Fixed modal height and positioning on screen 2019-01-08 19:23:06 +01:00
Fabio Manganiello
80bd5b684c Added support for setting/changing group streams on Snapcast 2019-01-08 17:43:20 +01:00
Fabio Manganiello
19eab381ae Weird Jinja bug broke the web panel load when using JSON parse, had to refactor it a bit to fix it 2019-01-08 13:53:21 +01:00
Fabio Manganiello
d91e494940 Added group and host modals and settings to Snapcast UI 2019-01-08 12:54:33 +01:00
Fabio Manganiello
382866b1a4 Added content to Snapcast group modal 2019-01-08 10:13:13 +01:00
Fabio Manganiello
fd8c3bb846 Connected the wires between Snapcast backend and frontend 2019-01-08 01:47:16 +01:00
Fabio Manganiello
a346442246 Draft for Snapcast UI style 2019-01-07 16:50:51 +01:00
Fabio Manganiello
004868f526 Added skeleton UI for Snapcast plugin on web panel 2019-01-07 15:34:31 +01:00
Fabio Manganiello
efad5a2bd7 Added Snapcast backend 2019-01-06 19:19:30 +01:00
Fabio Manganiello
9328566235 Selecting the default light group tab on web panel load if configured 2019-01-02 21:24:07 +01:00
Fabio Manganiello
5b9c54748e Do not propagate a null response message back to the bus to prevent backends from breaking 2019-01-02 09:29:27 +01:00
Fabio Manganiello
62045c2b5c Support for multiple resource_dirs on the HTTP backend
It is now possible to map multiple static resource directories to the
Flask HTTP server
2018-12-30 18:40:03 +01:00
Fabio Manganiello
9e28379203 Prevent js errors upon null artist or album 2018-12-30 15:43:09 +01:00
Fabio Manganiello
01006046e0 Don't try to push a Pushbullet note body to the bus if it's not a valid JSON 2018-12-27 22:45:31 +01:00
Fabio Manganiello
54c3381ae3 - Added frames throttling support on Leap Motion backend
- Moved the Leap listener to another process to prevent it from hanging the other backends
- Added support for sound and mix frequency analysis
2018-12-27 20:24:51 +01:00
Fabio Manganiello
cff4563dae Rewritten Pushbullet backend using pushbullet.py for better stability 2018-12-27 02:29:44 +01:00
Fabio Manganiello
c445763979 - Support for sound "release" (removal from active stream)
- Added `query_ports` method to MIDI plugin
2018-12-27 00:09:05 +01:00
Fabio Manganiello
3554968468 Support for multiple sounds on the same stream 2018-12-26 16:10:14 +01:00
Fabio Manganiello
f53d1c06dc No need to be verbose upon Pushbullet websocket temporary disconnections 2018-12-24 14:33:27 +01:00
Fabio Manganiello
ef241b3769 More robust Pushbullet reconnection logic 2018-12-24 12:31:38 +01:00
Fabio Manganiello
b911d46315 Create a new event loop in the Pushbullet backend 2018-12-24 11:37:18 +01:00
Fabio Manganiello
6a48a53c0d Typo 2018-12-24 11:30:10 +01:00
Fabio Manganiello
186ade8f18 Refactored Pushbullet backend to remove the dependency from websocket-client and rely only on websockets 2018-12-18 19:01:51 +01:00
Fabio Manganiello
a226aad669 Added python-dateutil requirement 2018-12-19 00:09:21 +01:00
Fabio Manganiello
c8f7eb30aa Made Redis backend and plugin more robust.
- Redis arguments read either from the backend or the plugin
configuration as a fallback in case of partial conf

- send_message now falls back on the default Redis connection
configuration if *args and **kwargs are missing
2018-12-18 15:51:37 +01:00
Fabio Manganiello
eb439d227a Wrapped HTTP requests loop in a try-except block to prevent it from breaking in case of temporary failures 2018-12-05 15:55:19 +00:00
Fabio Manganiello
9421602e81 Removed duplicate log trace 2018-12-02 23:47:49 +01:00
Fabio Manganiello
7cd1efe2c6 Option to pair a specific device to the Wiimote backend 2018-12-02 23:44:17 +01:00
Fabio Manganiello
f677c79f54 Made inactivity timeout on Wiimote configurable 2018-12-01 19:38:43 +01:00
Fabio Manganiello
199e9fdba1 Better management of inactivity timeout on Wiimote 2018-12-01 19:22:10 +01:00
Fabio Manganiello
66b6f0bc8b Added Wiimote support docs; Added Wiimote connection/disconnection events 2018-12-01 18:55:13 +01:00
Fabio Manganiello
383a075f39 Handling Wiimote timeout on Wiimote backend 2018-12-01 18:43:18 +01:00
Fabio Manganiello
2b03276159 #46: Added Wiimote support 2018-12-01 17:56:31 +01:00
Fabio Manganiello
6603f64757 Enforced cast to string for any object posted to the Redis bus 2018-11-20 14:24:14 +00:00
Fabio Manganiello
2d8078b8bb Don't propagate the message from MQTT nor wait for a response if the message is null or its handler threw an exception 2018-11-10 01:16:32 +01:00
Fabio Manganiello
cda64865f3 Set the correct mimetype on the /execute endpoint 2018-11-09 23:43:47 +01:00
Fabio Manganiello
26ec213098 Make sure that the shitty MQTT backend doesn't break for no reason 2018-11-06 11:40:01 +01:00
Fabio Manganiello
56b87f3436 Support for default broker server configuration in MQTT plugin 2018-11-02 15:32:12 +00:00
Fabio Manganiello
788a2652c8 Support for TLS/SSL and user authentication on MQTT 2018-11-02 15:15:48 +00:00
Fabio Manganiello
c05fc9ee3f Added logic to propagate events to the websockets backend 2018-11-02 10:14:06 +00:00
Fabio Manganiello
cd3aea5cd6 typo 2018-11-02 00:07:42 +01:00
Fabio Manganiello
f1e1ee92d3 bool compatibility fix 2018-11-02 00:06:39 +01:00
Fabio Manganiello
51440d43fd Propagate SSL flag to the templates 2018-11-02 00:04:49 +01:00
Fabio Manganiello
e571d8ea41 Typo 2018-11-02 00:03:10 +01:00
Fabio Manganiello
a77a9c04b7 Missed SSL flag 2018-11-02 00:02:11 +01:00
Fabio Manganiello
3eed774d50 Added SSL to websockets js code as well 2018-11-02 00:00:10 +01:00
Fabio Manganiello
727b604bb4 Added SSL to HTTP backend websockets as well 2018-11-01 23:57:50 +01:00
Fabio Manganiello
a253e5f49e Removed old line of code 2018-11-01 23:48:25 +01:00
Fabio Manganiello
667d5e8a45 HTTPS support on the web server 2018-11-01 23:43:02 +01:00
Fabio Manganiello
38a8cac9c6 Refactored SSL context logic as utils methods 2018-11-01 23:34:14 +01:00
Fabio Manganiello
6bc976cf89 Fixed SSL support in websocket implementation 2018-11-01 17:28:54 +00:00
Fabio Manganiello
b365e7d126 Keep-alive logic implemented for websocket backend 2018-10-27 01:09:09 +02:00
Fabio Manganiello
92a3759721 Added websocket backend and plugin 2018-10-26 21:55:49 +02:00
Fabio Manganiello
8635ed8268 Added support for MQTT backend to process responses on a topic named platypush_bus_mq/<device>/responses/<msg_id> 2018-10-26 13:33:23 +00:00