Commit graph

344 commits

Author SHA1 Message Date
cce6c4c5ad
[#284] Merged assistant.google plugin and backend.
This removes the deprecated `assistant.google` backend and also adds a
new `conversation_start_sound` parameter.
2023-10-22 19:55:11 +02:00
4883f49b19
Removed unused travisci events. 2023-10-21 19:15:34 +02:00
8b9ac59167
parse_numpy should also catch AttributeError. 2023-10-12 03:24:03 +02:00
9acd71944c
Skip numpy types serialization errors on Message.Encoder. 2023-10-09 01:33:45 +02:00
40d3ad1150
Removed <type> | None type hints.
They break on Python < 3.10.
2023-10-03 01:15:13 +02:00
761f2768cb
[#316] Added RPM dependencies. 2023-09-21 23:20:06 +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
0dc380fa94
Removed dependency from prctl.
Also, black'd and LINT-fixed some files that hadn't been touched in a
while.
2023-07-23 19:17:30 +02:00
3eda0c6f17
[#268] Implemented XMPP integration. 2023-07-22 22:36:36 +02:00
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
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
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
f2540437b7
Sound plugin rewritten almost from scratch. 2023-06-27 13:31:38 +02:00
cfedcd701e
Performance improvements when loading the Tensorflow plugin.
The Tensorflow module may take a few seconds to load the first time and
slow down the first scan of the plugins.

All the Tensorflow imports should therefore be placed close to where
they are used instead of being defined at the top of the module.
2023-05-11 19:48:22 +02:00
c690230930
An AssistantEvent should not fail initialization if the assistant integration isn't found. 2023-05-04 00:28:50 +02:00
ff9b76477d
Fixed arguments naming. 2023-04-28 11:04:33 +02:00
162904f281
[#253] Added support for relational filters on event hooks. 2023-04-27 22:07:02 +02:00
245472a4c5
Better event hooks filters.
- Support for nested attributes on event hook conditions. Things like
  these are now possible:

```
from platypush.event.hook import hook
from platypush.message.event.entities import EntityUpdateEvent

@hook(EntityUpdateEvent, entity={"external_id": "system:cpu"})
def on_cpu_update_event(event: EntityUpdateEvent, **_):
    print(event.args["entity"]["percent"])
```

- The scoring/regex extraction/partial string match logic in
  `_matches_argument` is actually only needed for
  `SpeechRecognizedEvent`. Other events don't need these features, and
  event hooks may be actually triggered unexpectedly in case of partial
  matches. Therefore, the "complex" `_matches_argument` has been moved
  as an override only for `SpeechRecognizedEvent`, and all the other
  events will perform simple key-value matching.
2023-04-26 01:45:58 +02:00
bfa296e7c5
Fixed dataclass JSON serialization 2023-04-24 01:18:33 +02:00
6711b26137
Support dataclass serialization in the standard message serializer. 2023-04-24 00:43:06 +02:00
27b1048789
Converted system.processes to the new data model. 2023-04-23 02:08:43 +02:00
387616ea96
Convert system.connected_users to the new data model. 2023-04-23 01:12:07 +02:00
a72c32cb00
Added battery entity support to system plugin. 2023-04-23 00:41:21 +02:00
b3440ab96b
Added support for fan sensors on the system plugin. 2023-04-23 00:08:27 +02:00
45d5f439be
Added support for system temperature sensor entities. 2023-04-22 22:42:11 +02:00
374f936c1f
Merged network_stats into NetworkInterface model. 2023-04-22 17:19:24 +02:00
977b55dea9
Merged network addresses into NetworkInterface model. 2023-04-22 17:19:23 +02:00
b3a0896485
Converted NetworkConnection schema/response. 2023-04-22 17:19:22 +02:00
98a300c4b1
Added NetworkInterface entities to system plugin.
Plus, `platypush.schemas.system` has now been split into multiple
submodules to avoid a single-file mega-module with all the system
schemas definitions.
2023-04-21 00:45:15 +02:00
44b8fd4b34
Support for disk entities in the system integration. 2023-04-20 16:26:51 +02:00
4ebfbf3851
Added memory stats entities. 2023-04-19 01:31:11 +02:00
1cee0459cf
Added CpuFrequency entity to system. 2023-04-18 01:49:36 +02:00
a5b0a524f6
Added CpuStats entity to system. 2023-04-18 01:19:06 +02:00
711cc2b239
Removed (now unused) CpuTimesResponse. 2023-04-17 02:25:03 +02:00
3e3c48d779
Defined new entity and schema for CpuInfo. 2023-04-17 02:25:02 +02:00
31f411868c
Message.Encoder should serialize binary data to 0x-led hex strings. 2023-04-02 02:43:06 +02:00
bf75eb73ac
Added an abstract base SensorDataEvent for sensor events. 2023-03-31 22:51:35 +02:00
c0251ef2f7
s/instance/instance_name/g in LinodeInstanceStatusChanged.
For sake of consistency - we also have `instance_id` and having the
instance name assigned to the `instance` attribute is quite ambiguous.
2023-03-26 22:58:20 +02:00
30124e7cef
Fixed docstring of Event.__init__. 2023-03-26 22:53:11 +02:00
bc2730c841
Rewritten linode integration.
- Support for cloud instances as native entities.
- Using Marshmallow dataclasses+schemas instead of custom `Response`
  objects.
- Merge `linode` backend into `linode` plugin.
2023-03-26 11:23:33 +02:00
89d85baa6d
Support for implicit serialization of Enum values in JSONAble. 2023-03-26 03:43:04 +02:00
2411b961e8
[WIP] Big, big refactor of the Bluetooth integration.
- Merged together Bluetooth legacy and BLE plugins and scanners.
- Introduced Theengs as a dependency to infer BLE device types and
  create sub-entities appropriately.
- Using `BluetoothDevice` and `BluetoothService` entities as the bread
  and butter for all the Bluetooth plugin's components.
- Using a shared cache of devices and services between the legacy and
  BLE integrations, with merging/coalescing logic included.
- Extended list of discoverable services to include all those officially
  supported by the Bluetooth specs.
- Instantiate a separate pool of workers to discover services.
- Refactor of the Bluetooth events - all of them are now instantiated
  from a single `BluetoothDevice` object.
2023-03-13 02:31:21 +01:00
1781a19a79
s/Entity.to_json/Entity.to_dict/g
stuff
2023-03-06 23:46:33 +01:00
7be55e446f
Convert UUID objects to strings when serializing to JSON. 2023-03-02 21:58:26 +01:00
70d1bb893c
A cleaner way of calculating the success response attribute. 2023-02-25 01:58:09 +01:00
a5a923a752
Added BluetoothDeviceNewDataEvent.
These events handle the case where a Bluetooth device only publishes new
service data without advertising any additional updated properties.
2023-02-22 02:23:11 +01:00
613e32e7c1
Extended number of supported events and data fields in Bluetooth integration. 2023-02-18 01:15:10 +01:00
a3aa186ddf
- Added support for scan_pause/scan_resume on bluetooth integration.
- Added `BluetoothDevice` as its own entity type.
2023-02-13 23:12:25 +01:00
575635fd6b
Defined set as a base method for all plugins that implement writeable entities 2023-02-11 04:04:21 +01:00