Commit graph

4270 commits

Author SHA1 Message Date
63afd90701
Serialize exceptions in the default JSON serializers.
This allows us to easily pass errors in internal JSON payloads, and
ensure that these are serialized consistently across all the
integrations.
2023-07-22 15:14:05 +02:00
cef9d0e007
Always serialize exception names when logging/returning request exceptions. 2023-07-22 15:13:17 +02:00
d49e5b1f6a
Expose Config.workdir property.
This is a useful proxy to avoid using `Config.get('workdir')` string
lookup.
2023-07-22 15:11:58 +02:00
c846c61493
Refactored Config.__init__.
The constructor of the `Config` class had grown too big. It's much more
manageable if split into multiple sub-constructor helpers.
2023-07-15 13:38:07 +02:00
0a3d6add83
Support ./config.yaml as a config file location. 2023-07-15 01:29:41 +02:00
fa1364d854
Improved logging for requests, responses and events.
- The following logging namespaces are now used, to make it easier to
  filter only log lines related to the logged application message:

  - `platypush:events`
  - `platypush:requests`
  - `platypush:responses`

- Those messages are always logged as JSON, with no prefixes nor
  suffixes.

- Requests are always logged when executed - no more delegation to the
  upstream backend.

- Responses are always logged when fully populated (including `id`,
  `origin`, `target` etc.), instead of being logged when still partially
  populated. This makes it particularly easy to link request/response
  IDs directly from the logs.
2023-07-15 01:11:45 +02:00
cb04af0bbd
Catch TypeError when execution an action.
Most of TypeError are due to the user passing wrong data. It usually
doesn't mean that we have to fail hard and reload the plugin, nor retry
the call with the same parameters.
2023-07-14 22:20:27 +02:00
27cf1bec52
Removed some optional top-level imports.
Optional top-level imports in Tornado route declarations will trigger
`ImportError`. While this will just mean that those routes will be
skipped, it will also generate a lot of noise on the logs.
2023-07-01 03:13:38 +02:00
e0af2daaff
Bump version: 0.50.1 → 0.50.2 2023-06-30 23:12:40 +02:00
8c063e2d03
Updated CHANGELOG 2023-06-30 23:12:13 +02:00
42a990a132
Format string typo fix 2023-06-30 23:07:00 +02:00
9a7fc031d9
A more robust logic to detect plugins by class type in get_plugin. 2023-06-30 23:01:09 +02:00
f3b2386ed6
Bump version: 0.50.0 → 0.50.1 2023-06-28 02:44:13 +02:00
17044ebf6b
Updated setup.py version 2023-06-28 02:43:40 +02:00
08c3a1e11a
Bump version: 0.24.5 → 0.50.0 2023-06-28 02:23:09 +02:00
f5f0a2f5ab
Updated version number in the CHANGELOG 2023-06-28 02:20:27 +02:00
2f441e1aaa
Updated README.
- Added web panels screenshots.
- Added documentation for event hooks with structured/relational
  filters.
- Added documentation for the nginx configuration and the PWA support.
2023-06-28 02:18:35 +02:00
5e5403287e
The inspect plugin should not fail hard if the cache couldn't be loaded.
This can happen for many reasons - not only if the cache file is not
accessible, but also if the structure/signature of some pickled objects
has changed. In that case, we should invalidate the current cache and
re-initialize it instead of failing.
2023-06-28 01:33:12 +02:00
c5059f6908
Updated CHANGELOG 2023-06-28 00:12:03 +02:00
ba827b0248
Added sound plugin documentation.
- Added example of how to stream audio over HTTP.

- Added Portaudio to the apt/pacman dependencies.
2023-06-28 00:10:36 +02:00
a103ea49f1
Fixed ffmpeg/audio consumer synchronization upon timeout. 2023-06-27 15:12:15 +02:00
77f7cd8b90
Don't use typing.Self (yet).
typing.Self has only been introduced in Python 3.10.
2023-06-27 14:17:04 +02:00
b01bf43552 Merge pull request 'New streaming endpoints' (#265) from 264-streaming-endpoints into master
Reviewed-on: platypush/platypush#265
2023-06-27 13:38:12 +02:00
f2540437b7
Sound plugin rewritten almost from scratch. 2023-06-27 13:31:38 +02:00
2fb6e4d7d0
Updated webapp dist files 2023-06-16 15:48:23 +02:00
2f4229d7b1
pylint fixes for the camera plugin. 2023-06-16 15:40:05 +02:00
9aa8e4538a
Better termination logic for the ffmpeg audio converter. 2023-06-16 11:47:37 +02:00
a6351dddd4
Extracted AudioRecorder out of SoundPlugin. 2023-06-16 03:12:55 +02:00
da93f1b3b0
[Chore] pylint 2023-06-14 01:44:36 +02:00
c8786b75de
sound.recordplay merged into sound.record. 2023-06-12 22:15:02 +02:00
be794316a8
Merged sound.stream_recording and sound.record. 2023-06-12 13:06:02 +02:00
a415c5b231
Merged outfile/fifo logic in sound.stream_recording. 2023-06-12 12:33:14 +02:00
e238fcb6e4
Refactoring the sound plugin to use ffmpeg as a stream converter. 2023-06-11 12:48:49 +02:00
4587b262b0
Stream camera frames over HTTP using a Redis pub/sub mechanism. 2023-06-05 20:40:12 +02:00
d7208c6bbc
Refactored Tornado routes for native pub/sub support.
The Redis pub/sub mechanism is now a native feature for Tornado routes
through the `PubSubMixin`.

(Plus, lint/black chore for the sound plugin)
2023-05-30 21:58:27 +02:00
8b5eb82497
Camera stream writer fixes.
- The readiness condition should be `multiprocessing.Condition`, not
  `threading.Condition` - in most of the cases it will be checked in a
  multiprocess environment.

- Fixed parameter name for `write`.
2023-05-30 11:06:48 +02:00
4fffabd82a
Revert "Removed camera.gstreamer."
This reverts commit b4d714df8a.
2023-05-29 22:13:24 +02:00
4bf9c01ac9
Moved camera routes.
Camera routes migrated from Flask blueprints to Tornado handlers.
2023-05-27 22:24:45 +02:00
b4d714df8a
Removed camera.gstreamer.
Too much of a pain in the ass to handle, too many format options to
think of, too many combinations of pipelines to support, and if I don't
think of those beforehand then I'll have to offload all of that
complexity on the user.
2023-05-27 22:19:50 +02:00
1c40e5e843
Black'd the camera plugin and writer.
Also, proper fix for the multi-inheritance problem of
the ffmpeg writers.
2023-05-23 20:42:59 +02:00
a2f8e2f0d2
Fixed bottom margin for ConfirmDialog buttons 2023-05-22 16:44:53 +02:00
a7aabd7c52
Fixed handling of :meth: docstring annotations with relative paths. 2023-05-22 16:32:30 +02:00
7eca1c27c9
Blackened the qrcode and pushbullet plugins 2023-05-22 02:33:54 +02:00
aaac6488d6
Updated webapp dist files 2023-05-22 02:24:24 +02:00
d7405ad05d
Added multiple parsers for the entities referenced in docstrings.
The `inspect` plugin can now detect references to plugins, backends,
events, responses and schemas in docstrings and replace them either with
links to the documentation or auto-generated examples.
2023-05-22 02:20:58 +02:00
4f11d7cf74
Updated webapp dist files 2023-05-21 03:15:16 +02:00
b91c1eba6d
Parse :return: definitions from action docstrings too. 2023-05-21 03:05:19 +02:00
229b8f2985
Many improvements for the execute panel. 2023-05-21 03:04:52 +02:00
edf1dbee1d
Updated webapp dist files 2023-05-20 15:54:18 +02:00
5efc90ca17
Better PWA installation prompt.
Display a popup modal instead of a confirm box to prompt the user to
install the PWA app.

`confirm` blocks the JavaScript engine when run in `beforeMount` and
therefore the browser won't be able to proceed with `event.prompt()`.
2023-05-20 15:52:37 +02:00