Commit graph

2966 commits

Author SHA1 Message Date
c311987741
Removed typing.Final from some of the most commonly used modules.
`typing.Final` is not defined on Python < 3.8.
2023-09-26 23:50:10 +02:00
059f7a4b11 Merge branch 'master' into 316/rpm-support 2023-09-23 16:21:48 +02:00
2b981f6b68
Added python-croniter dependency to Fedora.
Plus, some clean up of the variables on .drone.yaml.
2023-09-23 16:20:28 +02:00
b797add90d
Modify shebang header for Mercury JS script.
The RPM build process wants an absolute path.
2023-09-23 16:16:13 +02:00
a872d6f554
Added Fedora to the available Docker base images. 2023-09-22 19:02:13 +02:00
79e24461cb
Coalesce to empty list if zigbee.mqtt.devices returns null. 2023-09-22 17:00:53 +02:00
55965e962c
Store the Philips Hue bridge configuration under our workdir.
By default, the `phue` library will store the file containing the token
and the bridge configuration under `~/.python_hue`.

That's outside of our application folder, and it can't easily be copied
around or added to Docker volumes.

We should instead have it under `<WORKDIR>/light.hue/config.json`, in
line with what the other plugins do, and if `~/.python_hue` is available
but `<WORKDIR>/light.hue/config.json` isn't then we should copy the
legacy file to the new one.
2023-09-22 16:58:44 +02:00
761f2768cb
[#316] Added RPM dependencies. 2023-09-21 23:20:06 +02:00
453b6becae
FIX: We shouldn't expand cfgfile if it's empty. 2023-09-21 01:18:15 +02:00
bdbe263905
Added croniter to system dependencies.
The python-croniter package has now been added both to Arch's and
Debian's official repos, so we can install it via pacman or apt rather
than pip.
2023-09-21 01:07:49 +02:00
648b4224bb
[#285] Removed old covid19 backend.
Those endpoints aren't even working anymore.

Closes: #285
2023-09-21 00:26:35 +02:00
5d6d37785e
[#288] Removed legacy http.poll backend.
Closes: #288
2023-09-20 23:53:12 +02:00
7ba9a8930a
[#291] Removed deprecated light.hue backend.
Closes: #291
2023-09-20 23:46:40 +02:00
a6efaad26d
[#306] Removed Travis CI integration.
I've tried my best to keep it around, but the endpoints seem to be
broken, they no longer have a link to their API v3 documentation, and
the API Explorer that was supposed to be in the dashboard is gone.
2023-09-20 23:31:58 +02:00
3970470e17 Removed typing-inspect dependenccy 2023-09-18 14:25:50 +02:00
3e8d6bb01e Removed typing-extensions dependency.
The package isn't present on older versions of Debian.
2023-09-18 14:05:39 +02:00
07c88c9530
Added logic to prevent socket leakage from paho-mqtt upon client stop. 2023-09-17 23:43:56 +02:00
3f4168eb69
Support for new Quality enumeration constants on tidalapi. 2023-09-17 22:40:26 +02:00
c6cda86b1c
LINT/regex fix for ESP plugin. 2023-09-17 17:10:40 +02:00
4c4a33dc7c
Added Bluetooth example configuration to sample config.yaml. 2023-09-17 03:25:21 +02:00
46167a6c2a
Removed legacy zwave backend. 2023-09-17 02:46:24 +02:00
190cfa21b5
Fixed documentation references to some non-existing events. 2023-09-17 02:41:55 +02:00
0421325b26
Support to register/unregister custom handlers on the bus. 2023-09-17 02:29:11 +02:00
2e004c1a1e
get_all_plugins should use Message.Encoder for encoding the response.
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
fa2b84a269
Updated example configuration for mqtt and mqtt-based plugins. 2023-09-16 15:26:07 +02:00
2fcd623c51
Migrated zwave.mqtt integration.
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
52cb1afb4b
Don't break words in entity value frames. 2023-09-16 02:58:17 +02:00
e947cb1e67
Updated web dist files 2023-09-15 16:22:40 +02:00
4223576016
We should always update the entities cache on addEntity.
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
1020b63da7
All EntityMixin components should be allowed to emit loading events. 2023-09-15 00:34:29 +02:00
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
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
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
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
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
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
8ab7b6bebc
Removed deprecated zigbee.mqtt backend.
Closes: #322
2023-09-06 02:54:48 +02:00
3de510da68
Migrated zigbee.mqtt integration.
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
33a1ef39e4
Refactored and merged backend.mqtt logic into mqtt plugin. 2023-09-06 02:43:45 +02:00
b746d0b402
Moved get_message_response to platypush.utils.
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
f1acff00e9
Put the join back on CommandStream.__exit__.
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
b3c82fe0d1
More resilient termination logic for CommandStream. 2023-09-04 02:47:18 +02:00
c69f97c0a5
Updated default config.yaml.
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
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
b6c0ff799b
Rewritten the http.webpage plugin. 2023-09-03 17:33:25 +02:00
669f2eb2d2
LINT/black for tts.mimic3 plugin. 2023-09-02 12:40:34 +02:00
35416f3ee3
Some LINT on the old http.request.rss plugin. 2023-09-02 01:01:16 +02:00
9aaf2559fa
Added utils.is_root method. 2023-08-31 23:21:32 +02:00
e6b5abe909
Added SIGTERM handler for clean termination in Docker contexts. 2023-08-31 02:09:23 +02:00
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