Commit Graph

3567 Commits

Author SHA1 Message Date
Fabio Manganiello c6cda86b1c
LINT/regex fix for ESP plugin. 2023-09-17 17:10:40 +02:00
Fabio Manganiello ecba2e49ac
Do not remove the existing webapp's dist folder in build-ui.
continuous-integration/drone/push Build is passing Details
2023-09-17 12:56:54 +02:00
Fabio Manganiello 4c4a33dc7c
Added Bluetooth example configuration to sample config.yaml.
continuous-integration/drone/push Build is passing Details
2023-09-17 03:25:21 +02:00
Fabio Manganiello 9e7b95583b Merge pull request 'Merge `mqtt` backend and plugin' (#320) from 315/merge-mqtt-backend-and-plugin into master
continuous-integration/drone/push Build is failing Details
Reviewed-on: #320
2023-09-17 02:51:47 +02:00
Fabio Manganiello c4352660a4
Documentation update.
continuous-integration/drone/push Build is passing Details
Removed references to the legacy zwave plugin and backend.
2023-09-17 02:47:04 +02:00
Fabio Manganiello 46167a6c2a
Removed legacy zwave backend. 2023-09-17 02:46:24 +02:00
Fabio Manganiello 190cfa21b5
Fixed documentation references to some non-existing events. 2023-09-17 02:41:55 +02:00
Fabio Manganiello 0421325b26
Support to register/unregister custom handlers on the bus. 2023-09-17 02:29:11 +02:00
Fabio Manganiello 2e004c1a1e
`get_all_plugins` should use `Message.Encoder` for encoding the response.
continuous-integration/drone/push Build is passing Details
Some plugin information may include enums, tuples and other types that
aren't serializable by the default JSON serializer.
2023-09-17 02:11:52 +02:00
Fabio Manganiello fa2b84a269
Updated example configuration for mqtt and mqtt-based plugins.
continuous-integration/drone/push Build is passing Details
2023-09-16 15:26:07 +02:00
Fabio Manganiello 2fcd623c51
Migrated zwave.mqtt integration.
continuous-integration/drone/push Build is passing Details
Merged the zwave.mqtt plugin with the listener and removed the
leftovers of the legacy zwave plugin.
2023-09-16 03:58:19 +02:00
Fabio Manganiello 52cb1afb4b
Don't break words in entity value frames. 2023-09-16 02:58:17 +02:00
Fabio Manganiello e947cb1e67
Updated web dist files 2023-09-15 16:22:40 +02:00
Fabio Manganiello 4223576016
We should always update the entities cache on addEntity.
continuous-integration/drone/push Build is passing Details
Updating the entity cache only when we receive an event from a root
entity means that we lose events sent by individual child entities.
2023-09-15 00:45:38 +02:00
Fabio Manganiello 1020b63da7
All EntityMixin components should be allowed to emit `loading` events. 2023-09-15 00:34:29 +02:00
Fabio Manganiello 2c93049ee5
Catch all the exceptions in a plugin action wrapper.
The @action decorator should capture all the exceptions,
log them and return them on `Response.errors`.

This ensures that uncaught exceptions from plugin
actions won't unwind out of control, and also that they
are logged and treated consistently across all the
integrations.
2023-09-14 23:08:23 +02:00
Fabio Manganiello ac72b2f7a8
Fixed management of state on `zigbee.mqtt`.
Before the merge of the plugin and the listener those components
used to have their own separate state, which led to inconsistencies.
2023-09-14 23:05:27 +02:00
Fabio Manganiello 5a514fdcce
Only support the `run_topic` logic on the MQTT plugin.
Plugins that extend `MqttPlugin` shouldn't run messages as
requests, even if the parent MQTT plugin is configured to
do so.
2023-09-14 01:09:03 +02:00
Fabio Manganiello 4cb5aa7acb
Prepend the class name to the string used to generate the MQTT client_id hash.
If we include the class name by default then we won't have to
explicitly modify the client_id in the implementation classes
in order to prevent clashes.
2023-09-14 01:06:53 +02:00
Fabio Manganiello 3104a59f44
Better processing of configuration file parameters.
- Do `abspath`+`expanduser` on the configuration file path before
  checking if it exists.

- If the path doesn't exist, but the user explicitly passed a
  configuration file, then copy/create the default configuration
  under the specified directory.
2023-09-14 00:24:52 +02:00
Fabio Manganiello ddd8f1afdc
`base_topic` param in `zigbee.mqtt` renamed to `topic_prefix`.
This is for sake of consistency with other integrations (like
`zwave.mqtt`) that also use the same parameter name for the MQTT topic
prefix.
2023-09-07 21:32:56 +02:00
Fabio Manganiello 8ab7b6bebc
Removed deprecated `zigbee.mqtt` backend.
continuous-integration/drone/push Build is passing Details
Closes: #322
2023-09-06 02:54:48 +02:00
Fabio Manganiello 3de510da68
Migrated `zigbee.mqtt` integration.
continuous-integration/drone/push Build is passing Details
The plugin has been migrated to the new `mqtt` API and the legacy
listener that extended `MqttBackend` has been removed and merged into
the plugin.
2023-09-06 02:44:56 +02:00
Fabio Manganiello 33a1ef39e4
Refactored and merged `backend.mqtt` logic into `mqtt` plugin. 2023-09-06 02:43:45 +02:00
Fabio Manganiello b746d0b402
Moved `get_message_response` to `platypush.utils`.
continuous-integration/drone/push Build is passing Details
It is general-purpose enough to be used by all the integrations, not
only by the HTTP backend.
2023-09-05 13:03:30 +02:00
Fabio Manganiello f1acff00e9
Put the join back on `CommandStream.__exit__`.
continuous-integration/drone/push Build is passing Details
We want to give the process a bit of slack between the terminate and the
close, or we'll be guaranteed to get race conditions upon close.
2023-09-04 11:01:34 +02:00
Fabio Manganiello 6ee064cb89
Always rebase on pull in .drone.yml.
continuous-integration/drone/push Build is passing Details
2023-09-04 02:53:20 +02:00
Fabio Manganiello 82ef928d5b Merge pull request 'Better Docker support' (#277) from 276/better-docker into master
continuous-integration/drone/push Build is failing Details
Reviewed-on: #277
2023-09-04 02:49:14 +02:00
Fabio Manganiello b3c82fe0d1
More resilient termination logic for `CommandStream`.
continuous-integration/drone/push Build is passing Details
2023-09-04 02:47:18 +02:00
Fabio Manganiello c69f97c0a5
Updated default config.yaml.
continuous-integration/drone/push Build is passing Details
The new configuration:

- Enables `backend.http` by default
- Removes the extra `config.auto.yaml` dependency
- Includes many more examples, lots of updates for existing examples,
  and extensive comments.
2023-09-04 02:22:46 +02:00
Fabio Manganiello 07c2eee890
Changed (fixed) default location for config dir if not existing.
Following some common UNIX conventions, if no configuration file is
specified and none exists under the default locations, then a new
configuration directory should be created under:

```
- if root: /etc/platypush
- else:
  - if XDG_CONFIG_HOME:
    - $XDG_CONFIG_HOME/platypush
  - else:
    - ~/.config/platypush
```
2023-09-04 02:19:13 +02:00
Fabio Manganiello b6c0ff799b
Rewritten the `http.webpage` plugin. 2023-09-03 17:33:25 +02:00
Fabio Manganiello 669f2eb2d2
LINT/black for `tts.mimic3` plugin. 2023-09-02 12:40:34 +02:00
Fabio Manganiello 35416f3ee3
Some LINT on the old `http.request.rss` plugin. 2023-09-02 01:01:16 +02:00
Fabio Manganiello 759075f1d9
Updated sample nginx configuration. 2023-09-01 01:09:38 +02:00
Fabio Manganiello 5481ae753d
gitignore should only skip /config, not any config directories. 2023-08-31 23:56:57 +02:00
Fabio Manganiello 9aaf2559fa
Added `utils.is_root` method. 2023-08-31 23:21:32 +02:00
Fabio Manganiello 1be40f30d6
Merge branch 'master' into 276/better-docker
continuous-integration/drone/push Build is passing Details
2023-08-31 02:34:17 +02:00
Fabio Manganiello 011f6d3a66
(Try and) pull the current branch from Github instead of master.
continuous-integration/drone/push Build is passing Details
2023-08-31 02:32:42 +02:00
Fabio Manganiello 86ce2647e4
Removed the -f flag from git push.
continuous-integration/drone/push Build is failing Details
2023-08-31 02:23:13 +02:00
Fabio Manganiello 867198a092
Try and force push the commits to Github.
continuous-integration/drone/push Build is passing Details
2023-08-31 02:22:01 +02:00
Fabio Manganiello a87a713f5e
Ignore the Dockerfile in the root folder
continuous-integration/drone/push Build is failing Details
2023-08-31 02:15:59 +02:00
Fabio Manganiello a88b57fff2
Dockerfile moved to application root 2023-08-31 02:15:59 +02:00
Fabio Manganiello 91fde717c9
Dockerfile moved to application root 2023-08-31 02:15:59 +02:00
Fabio Manganiello 0e02e617b3
Skip checksum in platypush-git AUR package.
The master branch can move fast and easily get out of sync with the
released version.
2023-08-31 02:15:58 +02:00
Fabio Manganiello ee955882bf
Always rebase when pulling from the Github remote.
continuous-integration/drone/push Build is failing Details
2023-08-31 02:11:50 +02:00
Fabio Manganiello e6b5abe909
Added SIGTERM handler for clean termination in Docker contexts.
continuous-integration/drone/push Build is failing Details
2023-08-31 02:09:23 +02:00
Fabio Manganiello 4dd713ffd2
Refactored Platydock and Platyvenv.
The two scripts now share the same command interface, behaviour and base
class.

Also, Platydock now builds a Docker image instead of just printing a
Dockerfile, unless the `--print` option is passed.
2023-08-31 01:16:56 +02:00
Fabio Manganiello 446bc2f674
Skip checksum in platypush-git AUR package.
continuous-integration/drone/push Build is passing Details
The master branch can move fast and easily get out of sync with the
released version.
2023-08-30 00:05:38 +02:00
Fabio Manganiello 429658e7c8
Refactored `PackageManager` classes.
continuous-integration/drone/push Build is passing Details
Instead of having a custom `get_installed` callable field, with
replicated code for each package manager, the field has now been
promoted to a class method containing the common logic, and the
instances now expect a `list` field (base command to list the installed
packages using the specified package manager) and a `parse_list_line`
callback field (to extract the base package name given a raw line from
the command above).

Also, we shouldn't run the list command if we're running within a Docker
context - the host and container environments will be different.
2023-08-28 01:26:19 +02:00