Fabio Manganiello
14e7b44f86
Updated dist files
2023-05-20 02:36:24 +02:00
Fabio Manganiello
ca342ee3ea
Removed XML header from the generated SVG
2023-05-20 02:34:07 +02:00
Fabio Manganiello
14d6924338
Added beforeinstallprompt listener
2023-05-20 02:33:26 +02:00
Fabio Manganiello
9ba7ad9402
Removed XML header from the generated SVG
2023-05-20 02:32:48 +02:00
Fabio Manganiello
d3dde80269
Display the logo directly as an SVG on the login/registration page.
2023-05-20 02:31:26 +02:00
Fabio Manganiello
47395f0b03
Updated icon files
2023-05-20 02:21:35 +02:00
Fabio Manganiello
075efde58c
Added route to dynamically generate logo.svg.
2023-05-20 01:18:48 +02:00
Fabio Manganiello
c5aee0a65d
Updated webapp dist files
2023-05-18 03:17:24 +02:00
Fabio Manganiello
795754f858
Added PWA support
2023-05-18 03:12:48 +02:00
Fabio Manganiello
27d4a20418
Use reflection to infer the arguments of a Python user procedure
2023-05-17 17:17:59 +02:00
Fabio Manganiello
0a1209fe6e
Updated webapp dist files
2023-05-17 10:56:37 +02:00
Fabio Manganiello
33e2879413
Various UI improvements for the execute tab.
2023-05-17 10:41:02 +02:00
Fabio Manganiello
91daec579d
Reverted to the previous style for entities on mobile.
...
Better to use screen width wisely and avoid unnecessary padding.
2023-05-17 01:13:09 +02:00
Fabio Manganiello
61ea3d79e4
Large refactor for the `inspect` plugin.
...
More common logic has been extracted and all the methods and classes
have been documented and black'd.
2023-05-17 00:05:22 +02:00
Fabio Manganiello
2cba504e3b
Improvements for the autocomplete component.
2023-05-14 15:07:54 +02:00
Fabio Manganiello
8447f9a854
Improved rendering of actions/arguments documentation.
...
The frontend now calls `utils.rst_to_html` to render the docstrings as
HTML instead of dumping them as raw text.
Also, actions and arguments are now cached to improve performance.
2023-05-14 15:06:34 +02:00
Fabio Manganiello
5f2d6dfeb5
Added `utils.rst_to_html` action.
2023-05-14 15:05:24 +02:00
Fabio Manganiello
3c83e7f412
A faster implementation for the `inspect.get_*` methods.
...
Plugin/backend lookup is now done by inspecting the manifest files
instead of searching all the subpackages.
2023-05-13 13:44:46 +02:00
Fabio Manganiello
72797e73ff
Changed the Tornado paradigm to start the WSGI workers.
...
Use `bind_sockets`/`fork_processes` instead of reinventing the wheel
with our own multiprocessing handling.
2023-05-13 12:35:20 +02:00
Fabio Manganiello
ac4fe4447e
Revert "Added a multi-worker approach to the Tornado WSGI container."
...
This reverts commit 71401a4936
.
Temporarily reverted this commit because the `reuse_address` on the
application's `listen` method has only been implemented in Tornado 6.2 -
and Debian stable still shipts Tornado 6.1.
2023-05-13 02:36:20 +02:00
Fabio Manganiello
71401a4936
Added a multi-worker approach to the Tornado WSGI container.
...
The WSGI container is a good option to wrap a multi-modal webapp
(Flask + websocket routes), but it's constrained to a single-process
approach and queued/pre-buffered requests. That makes performance poor
when handling requests that may take a few seconds to complete.
2023-05-13 01:26:18 +02:00
Fabio Manganiello
b7b93edbae
Updated dist files
2023-05-12 03:52:33 +02:00
Fabio Manganiello
a15191d4ca
Updated dist files
2023-05-12 03:51:59 +02:00
Fabio Manganiello
d4f8e51caf
A less blocking implementation of the entities loading UI logic.
2023-05-12 03:49:20 +02:00
Fabio Manganiello
62d846ddda
Updated dist files
2023-05-12 03:42:17 +02:00
Fabio Manganiello
23a5e90e2e
Updated dist files
2023-05-12 03:26:55 +02:00
Fabio Manganiello
6cd9cb6e76
Better entities caching on the frontend.
2023-05-12 03:18:22 +02:00
Fabio Manganiello
79871e0fa1
Fixed devServer routes in vue.config.js.
...
Use `127.0.0.1` instead of `localhost` for the Vue proxy.
2023-05-12 02:57:14 +02:00
Fabio Manganiello
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
Fabio Manganiello
f49ad4c349
Updated dist files
2023-05-10 02:52:24 +02:00
Fabio Manganiello
6b0f0883ee
A proper way to proxy websocket calls using the Vue devServer.
2023-05-10 02:27:01 +02:00
Fabio Manganiello
78c12212c6
[ #260 ] A simple entities caching mechanism using the browser storage.
2023-05-10 02:26:06 +02:00
Fabio Manganiello
74ab884b7a
Proper redirects upon `/execute` failure.
...
If a call to `/execute` fails with a 401 or 412 status, then redirect
the user to `/register` or `/login`.
2023-05-10 02:24:50 +02:00
Fabio Manganiello
0de56ad52e
Added nginx sample configuration.
2023-05-10 00:59:41 +02:00
Fabio Manganiello
1395c472c0
`docutils` moved to required dependencies.
2023-05-09 21:59:36 +02:00
Fabio Manganiello
41233138ff
Blackened `inspect` module and extracted model defs to adjacent module.
2023-05-09 21:58:02 +02:00
Fabio Manganiello
b91aedc553
Updated README toc format
2023-05-09 02:56:44 +02:00
Fabio Manganiello
5415f0ccf3
Updated README
2023-05-09 02:54:02 +02:00
Fabio Manganiello
ab2425ebd0
[ #260 ] Removed legacy `backend.websocket`.
...
It has now been replaced by the `/ws/events` and `/ws/requests`
websocket routes under `backend.http`.
2023-05-09 02:46:43 +02:00
Fabio Manganiello
a069d23bb7
[ #260 ] Added ``/ws/requests`` websocket route.
2023-05-09 02:40:32 +02:00
Fabio Manganiello
7716a416e9
[ #260 ] Support for sending events via websocket over `/ws/events`.
2023-05-09 02:18:58 +02:00
Fabio Manganiello
edb7197f71
[ #260 ] Implemented authentication for websocket routes.
...
Plus, refactored the `backend.http.app.utils` module by breaking it down
into multiple components, as the module was starting to get too large.
2023-05-09 00:03:11 +02:00
Fabio Manganiello
2d4b179879
Include the path info in the logging messages in WSRoute.
2023-05-08 12:35:54 +02:00
Fabio Manganiello
3fc622e296
Remove legacy references to the websocket HTTP port and backend in platydock.
2023-05-08 12:25:09 +02:00
Fabio Manganiello
f5fcccb0bd
Refactored the new websocket routes.
...
Defined a `platypush.backend.http.ws` package with all the routes, a
base `WSRoute` class that all the websocket routes can extend, and a
logic in the HTTP backend to automatically scan the package to register
exposed websocket routes.
2023-05-08 11:45:14 +02:00
Fabio Manganiello
56dc8d0972
Migrated the webapp to Tornado.
...
It was just too painful to find a combination of versions of gunicorn,
gevent, eventlet, pyuwsgi etc. that could work on all of my systems.
On the other hand, Tornado works out of the box with no headaches.
Also in this commit:
- Updated a bunch of outdated/required integration dependencies.
- Black'd and LINTed a couple of old plugins.
2023-05-08 02:06:45 +02:00
Fabio Manganiello
f81e9061a3
`lifespan=on` is actually not required on Flask config level.
2023-05-07 16:30:41 +02:00
Fabio Manganiello
692180c653
Back to uvicorn workers from eventlet.
...
The eventlet API has way too many dependency issues with gunicorn.
Still TODO: Fix or at least mitigate the WSGI workers timeout issue when
they handle websocket connections.
2023-05-07 15:37:58 +02:00
Fabio Manganiello
8102178ba4
Updated dist files
2023-05-07 13:00:48 +02:00
Fabio Manganiello
29c0a11c37
Forced to use the gunicorn version on Github.
...
Reason: gunicorn maintainers no longer give a fuck about their project
and they aren't letting anybody take over either - see
https://github.com/benoitc/gunicorn/pull/2581
This is not how a FOSS project should be run. A project with 9k stars
and countless usages shouldn't end up in a situation where users beg for
two years for a new release that fixes a bad regression and a bad
security vulnerability. The way gunicorn is maintained and run is an
insult to the whole FOSS community.
2023-05-07 12:54:50 +02:00
Fabio Manganiello
c0a948f8ce
Removed remaining references to websocket port.
2023-05-07 12:54:13 +02:00
Fabio Manganiello
bdbbd24e6f
Only include /ws/events as a proxied websocket, without messing with the /ws route exposed by the Vue debugger
2023-05-07 12:22:51 +02:00
Fabio Manganiello
059fff8558
Updated dist files
2023-05-07 12:19:13 +02:00
Fabio Manganiello
f9b0bc905e
Migrated websocket service.
...
The websocket service is no longer provided by a different service,
controlled by a different thread running on another port.
Instead, it's now exposed directly over Flask routes, using
WSGI+eventlet+simple_websocket.
Also, the SSL context options have been removed from `backend.http`, for
sake of simplicity. If you want to enable SSL, you can serve Platypush
through a reverse proxy like nginx.
2023-05-07 12:08:28 +02:00
Fabio Manganiello
3aefc9607d
Migrated from waitress to gunicorn.
...
`waitress`, unlike `gunicorn`, doesn't provide an easy way to plug into
a WSGI socket that can be used for the websocket interface.
2023-05-07 00:42:57 +02:00
Fabio Manganiello
ca65db016e
Added description line to `conf.py`.
2023-05-06 23:26:07 +02:00
Fabio Manganiello
9951d62511
Added logic to automatically generate the secret key for Flask.
2023-05-06 22:04:48 +02:00
Fabio Manganiello
d1f0e1976c
Exclude squashfs/loopback mounts from `system.disk_info`.
2023-05-06 18:53:16 +02:00
Fabio Manganiello
e33a391d25
Updated dist files
2023-05-06 12:37:00 +02:00
Fabio Manganiello
4f78d61223
Improved UI on mobile.
2023-05-06 12:34:27 +02:00
Fabio Manganiello
6e939bbe62
Close modals and dropdown when ESC is pressed.
2023-05-05 20:46:42 +02:00
Fabio Manganiello
e9e59c857a
Updated dist files
2023-05-05 02:51:33 +02:00
Fabio Manganiello
59bf1c2aa0
Added close button to the modal's header.
2023-05-05 02:48:41 +02:00
Fabio Manganiello
8af3ae17b8
A more efficient way of detecting the entity groups to display.
...
Instead of iterating over each of the entities in a grouping to find out
which groups should be displayed based on the selector's policy, the
selector can directly keep its `selectedGroups` attribute in sync with
the index.
2023-05-05 02:33:34 +02:00
Fabio Manganiello
373788377b
Created two separate actions under `variable` to delete/unset.
...
`delete` will actually remove the record from the database (same as
`unset`'s new behaviour), while `unset` will set it to null without
deleting it (same as the `unset`'s previous behaviour).
2023-05-05 02:21:18 +02:00
Fabio Manganiello
98b9d31dd4
Updated dist files
2023-05-05 01:10:24 +02:00
Fabio Manganiello
4383dbb2b4
Bluetooth UI toggle aligned to the right - like all other toggles.
2023-05-05 01:04:39 +02:00
Fabio Manganiello
285f3941d9
Always use an external uWSGI server to run the web service.
...
Added `waitress` dependency. For performance and security reasons, it's
better to always run the Flask application inside of a uWSGI server.
`waitress` also makes things easier by avoiding to ask the user to
manually provide the external executable arguments, as it was the case
with `uwsgi` and `gunicorn`.
2023-05-05 00:07:13 +02:00
Fabio Manganiello
2c254e8eb9
numpy and PIL should be required dependencies for all camera plugins.
2023-05-04 23:44:42 +02:00
Fabio Manganiello
99311a6e71
Updated dist files
2023-05-04 02:23:24 +02:00
Fabio Manganiello
7db09276ca
Some small style improvements.
2023-05-04 02:20:40 +02:00
Fabio Manganiello
2398cac572
A more efficient and clean logic for `selectedEntities` calculation.
2023-05-04 02:19:55 +02:00
Fabio Manganiello
394e27eaf2
Refactored style for UI dropdowns.
2023-05-04 02:19:09 +02:00
Fabio Manganiello
9fd7f7db04
Fixed compatibility with new Sphinx version
2023-05-04 01:05:27 +02:00
Fabio Manganiello
c690230930
An `AssistantEvent` should not fail initialization if the assistant integration isn't found.
2023-05-04 00:28:50 +02:00
Fabio Manganiello
04b1dad6d8
Removed `test_cron_execution_upon_system_clock_change`.
...
The test is too brittle as it depends on small mocked clock skews and it
can easily fail.
2023-05-04 00:11:11 +02:00
Fabio Manganiello
91d1d33ab6
Exclude `tests` from pip installation.
2023-05-03 21:45:02 +02:00
Fabio Manganiello
5d1c8cf8e9
Additional null check on this.searchTerm
2023-05-03 03:33:34 +02:00
Fabio Manganiello
3482c29679
Updated dist files
2023-05-03 03:18:44 +02:00
Fabio Manganiello
a06d0ef6a1
Merged all the items in the entities panel's header in the Selector component.
2023-05-03 03:14:46 +02:00
Fabio Manganiello
7c7818dd76
Fixed entity search.
...
It was broken by the previous refactor of the entities panel, which no
longer triggers the `watch` callback on the upstream `entityGroups`.
The new approach listens for entity updates on the frontend bus and
dynamically creates the entity groupings in `selectedGroups` if they are
missing.
2023-05-03 02:12:14 +02:00
Fabio Manganiello
9922305ac5
Fixed grouping for `entityGroups.id`.
...
Unlike the other entity groupings, which are 4-layered (`grouping ->
group -> entity_id -> entity`), the grouping by ID only needs 3 layers
(`grouping -> entity_id -> entity`).
2023-05-03 02:09:51 +02:00
Fabio Manganiello
cc2ec1db7f
The HTTP Zeroconf service should be registered before the server starts.
2023-05-02 21:24:50 +02:00
Fabio Manganiello
55cb87d14f
Updated dist files
2023-05-02 10:24:11 +02:00
Fabio Manganiello
68359b88a9
More performance improvements for the entities page.
...
- Don't recalculate entity groups every time. Instead, keep them in sync
every time an entity is added or removed.
- Removed `computedChildren` from the entity component - no null nodes
are guaranteed to be passed now, so there's no need for another
iteration on the list of children.
- `childrenByParentId` now only looks in the scope of the entity's
children instead of searching all the entities.
2023-05-02 10:14:03 +02:00
Fabio Manganiello
0fc0a22cd7
Reintroduced loading icon spin animation.
2023-05-02 10:08:36 +02:00
Fabio Manganiello
3febfabdd7
Bluetooth LE blacklisted device notices moved `info -> debug`.
2023-05-01 22:10:06 +02:00
Fabio Manganiello
998990aabc
Made `Entity.children_ids` resilient against deleted objects.
2023-05-01 22:09:16 +02:00
Fabio Manganiello
9d82ce6ea9
Noisy beacons notice back to debug level.
...
There's just too many of them and it ends up polluting the logs.
2023-05-01 21:25:42 +02:00
Fabio Manganiello
ce248ccfbb
Added `children_ids` to the entity attributes serialized in `to_json`.
2023-05-01 19:59:13 +02:00
Fabio Manganiello
de76c2b6a8
Updated dist files
2023-05-01 10:12:43 +02:00
Fabio Manganiello
835ad9f2dc
Use plugin as a default entity grouping instead of category
2023-05-01 10:06:11 +02:00
Fabio Manganiello
85ecdcb0cb
Removed entity icon loading animation.
...
The animation has a big impact on page loading performance when the
system includes a high number of entities that all need their loading
animation to be render.
2023-05-01 09:49:34 +02:00
Fabio Manganiello
24c6b7b377
Updated dist files
2023-05-01 01:25:27 +02:00
Fabio Manganiello
b7cf1a42de
Use a proxy value in the `variable` component for the textbox.
...
Otherwise the value may keep being overwritten while the user is typing
a new one.
2023-05-01 01:22:20 +02:00
Fabio Manganiello
a3839e637d
Set a max-width: 600px for group containers.
2023-05-01 01:22:02 +02:00
Fabio Manganiello
1e43866978
Moved more entity common CSS out of the Vue component.
2023-05-01 01:21:18 +02:00
Fabio Manganiello
de84a65a22
Show prettified entity type when hover the entity icon.
2023-05-01 01:20:31 +02:00
Fabio Manganiello
7906ee2c49
Entity components style improvements.
...
Multiple style improvements for the entity components. Among these:
- A more consistent style for entity values and toggler buttons.
- Fixed overflowing/underflowing entities on smaller/larger screen
sizes.
- Simplified the stylesheets for many entities as many component classes
have now been moved to `common.scss`.
2023-04-30 22:32:50 +02:00
Fabio Manganiello
d1066ba624
Use Math.round instead of parseInt when parsing durations.
2023-04-30 16:22:37 +02:00
Fabio Manganiello
5d4bffa119
Fixed retrieval of `entities` plugin.
2023-04-30 10:42:05 +02:00
Fabio Manganiello
94a493580c
Updated dist files
2023-04-30 01:36:13 +02:00
Fabio Manganiello
0b853e0a54
Apply `word-break: break-all` to entities' names and values.
...
The entity name and value in the component header may be arbitrarily
long and rendered on small screens.
We therefore need to ensure that the text won't overflow the screen
width.
2023-04-30 01:17:54 +02:00
Fabio Manganiello
3d7755159f
Improved compatibility for `traceback.format_exception`.
...
The new syntax, that only requires an `Exception` instance to be passed
to the function, is only compatible with Python >= 3.10.
2023-04-30 00:38:17 +02:00
Fabio Manganiello
12cca4991a
Fixed paths for Alembic's `package_data`.
2023-04-29 23:48:06 +02:00
Fabio Manganiello
6b28d16ccf
Exclude more noisy Bluetooth beacons.
...
Exclude any beacons from devices with no name, no children other than
services, and with none of those services being public/known.
2023-04-29 23:34:24 +02:00
Fabio Manganiello
f764d1b4fb
Noisy Bluetooth beacons notices should be logged on info level.
2023-04-29 23:18:12 +02:00
Fabio Manganiello
52f036dc1d
Updated dist files
2023-04-29 22:49:35 +02:00
Fabio Manganiello
cbf0ea8a19
Style fixes for mobile screens.
2023-04-29 22:45:10 +02:00
Fabio Manganiello
9ebdaf620e
Merge pull request '[ #255 ] Model variables as entities' ( #256 ) from 255-model-variables-as-entities into master
...
Reviewed-on: platypush/platypush#256
Closes : #255
2023-04-29 18:24:24 +02:00
Fabio Manganiello
e96885a805
Delete the entity on `variable.unset` instead of setting it to null.
2023-04-29 18:21:57 +02:00
Fabio Manganiello
b4048002b9
Updated dist files
2023-04-29 18:21:32 +02:00
Fabio Manganiello
6d9c34f06f
Added VariableModal to set variables from the dashboard.
2023-04-29 18:20:41 +02:00
Fabio Manganiello
a3888be216
The robustness check in case of missing fields should also apply to other system entities.
2023-04-29 16:08:38 +02:00
Fabio Manganiello
8c9768b05e
Robustness check for system disk entities.
...
When the system information is still loading it may happen that the
device associated to the disk hasn't been loaded yet.
2023-04-29 16:04:57 +02:00
Fabio Manganiello
a20065c649
Exposed `_entities` utility property in `Plugin`.
...
It can be used by other plugins to easily access the `entities` plugin,
along the lines of `db` and `redis`.
2023-04-29 15:50:31 +02:00
Fabio Manganiello
68d8befa34
Removed some vestigial commented code.
2023-04-29 15:28:44 +02:00
Fabio Manganiello
23b851e9d7
`variable.status` robustness fix.
...
`entities.transform_entities` will pass back an empty list instead of an
empty dict if no entities were found, and the function should be able to
handle it.
2023-04-29 15:24:58 +02:00
Fabio Manganiello
e919bf95ad
Print the full stack trace if a plugin failed in `entities.scan`
2023-04-29 15:14:13 +02:00
Fabio Manganiello
38c87ef39f
Added frontend component for the `Variable` entity.
2023-04-29 11:37:21 +02:00
Fabio Manganiello
f40f956507
Migrated `variable` table to the new entities framework.
2023-04-29 11:36:55 +02:00
Fabio Manganiello
8fe61217ce
Added `_db` and `_redis` properties to the Plugin class.
...
Plugins can now access the database and Redis APIs directly without
having to run their own `get_plugin` validation logic.
2023-04-29 11:35:57 +02:00
Fabio Manganiello
a8d2261f32
Added `core_plugins` to the configuration.
...
These plugins (only including `variable` for now) are a core part of the
application and should always be explicitly enabled.
2023-04-29 11:34:34 +02:00
Fabio Manganiello
78cee5d9b0
Added support for automatic database migrations.
...
Added Alembic environment and `run_db_migrations` logic to the entities
engine so database schema changes can be processed as soon as the
application is started.
2023-04-29 11:32:31 +02:00
Fabio Manganiello
ff9b76477d
Fixed arguments naming.
2023-04-28 11:04:33 +02:00
Fabio Manganiello
38262e245e
Merge pull request '[ #253 ] Support for relational filters on event hooks' ( #254 ) from 253-support-for-relational-filters-on-event-hooks into master
...
Reviewed-on: platypush/platypush#254
Closes : #253
2023-04-27 22:08:37 +02:00
Fabio Manganiello
162904f281
[ #253 ] Added support for relational filters on event hooks.
2023-04-27 22:07:02 +02:00
Fabio Manganiello
87db5ca5f3
Exclude all iBeacon devices by default (it's not only Apple, it's everyone)
2023-04-26 14:17:59 +02:00
Fabio Manganiello
7685521e2b
Always use the default configuration values for MQTT listeners if not specified
2023-04-26 03:30:05 +02:00
Fabio Manganiello
10d587efd0
FIX: Possible assert evaluation error.
...
Some versions/configurations of Python may throw `Boolean value of this
clause is not defined` here.
2023-04-26 02:25:28 +02:00
Fabio Manganiello
339786b123
Merge pull request 'Support for nested/partial event hook filters' ( #252 ) from 251-nested-filters-on-event-hooks into master
...
Reviewed-on: platypush/platypush#252
Closes : #251
2023-04-26 01:55:27 +02:00
Fabio Manganiello
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
Fabio Manganiello
ee54e0edbf
Use a font-awesome spinner instead of an animated gif when loading entities
2023-04-25 16:42:01 +02:00
Fabio Manganiello
cb288deb71
Exclude more noisy BLE beacons.
...
Excluding Apple iBeacons and devices with no name and no services.
2023-04-25 16:19:11 +02:00
Fabio Manganiello
99382e4505
Merge pull request 'Fixed compatibility with SQLAlchemy >= 2.0' ( #250 ) from 239-sqlalchemy-2-compatibility into master
...
Reviewed-on: platypush/platypush#250
Closes : #239
2023-04-25 10:47:27 +02:00
Fabio Manganiello
9c93b793e3
Merge branch 'master' into 239-sqlalchemy-2-compatibility
2023-04-25 10:44:31 +02:00
Fabio Manganiello
dd60b8924d
Wrap the `PRAGMA` statement in `sqlalchemy.text`.
...
SQLAlchemy 2 no longer supports raw strings passed to `.execute()`
methods.
2023-04-25 10:41:37 +02:00
Fabio Manganiello
440d70d9cf
LINT/format fixes.
2023-04-25 10:36:27 +02:00
Fabio Manganiello
4cc88fcf5f
Rewritten the `variable` plugin to use SQLAlchemy's ORM.
...
This removes the need for raw SQL statements and CREATE TABLE statements
that may be engine-specific.
2023-04-25 10:35:12 +02:00
Fabio Manganiello
e1cd22121a
Removed `connection.begin()` pattern from the `db` plugin.
...
SQLAlchemy should automatically begin a transaction on
connection/session creation. Plus, `.begin()` messes up things with
SQLAlchemy 2, which has `autobegin` enabled with no easy way of
disabling it.
2023-04-25 10:31:49 +02:00
Fabio Manganiello
f4e13d0cb0
No need for `session.begin` in `db.create_all`.
2023-04-24 23:57:47 +02:00
Fabio Manganiello
37722d12cd
No need for `session.begin` in `db.create_all`.
2023-04-24 23:55:50 +02:00
Fabio Manganiello
6fa179e769
LINT fixes
2023-04-24 23:49:31 +02:00
Fabio Manganiello
d33d760361
Better way to import `declarative_base` from SQLAlchemy.
...
Import `declarative_base` in a way that is compatible with any
SQLAlchemy version between 1.3 and 2.x.
2023-04-24 23:23:55 +02:00
Fabio Manganiello
91df18f7b5
Better way to import `declarative_base` from SQLAlchemy.
...
Import `declarative_base` in a way that is compatible with any
SQLAlchemy version between 1.3 and 2.x.
2023-04-24 23:21:39 +02:00
Fabio Manganiello
87889142e0
Fixed compatibility with SQLAlchemy >= 2.0 in the `db` plugin.
2023-04-24 22:52:17 +02:00
Fabio Manganiello
8478245cde
Removed `Mapped[Entity]` type annotation.
...
`Mapped` has been introduced only in SQLAlchemy 1.4, while Debian stable
still ships 1.3.
Removing the type annotation doesn't come with a big cost, but it keeps
Platypush compatible with Debian stable.
2023-04-24 21:48:52 +02:00
Fabio Manganiello
e955ffc018
Be more resilient in DateTimeWeather widget about custom temperature/humidity names or non-numeric data
2023-04-24 12:48:51 +02:00
Fabio Manganiello
5638c567ff
Show temperature and humidity on the DateTimeWeather widget upon sensor events only if the sensor data is numeric.
2023-04-24 10:59:45 +02:00
Fabio Manganiello
bfa296e7c5
Fixed dataclass JSON serialization
2023-04-24 01:18:33 +02:00
Fabio Manganiello
9c03b028d7
Be a bit more resilient if an upstream integration sent some empty entities
2023-04-24 00:44:16 +02:00
Fabio Manganiello
6711b26137
Support dataclass serialization in the standard message serializer.
2023-04-24 00:43:06 +02:00
Fabio Manganiello
dc3392c11d
Disk I/O stats are not always available and should therefore be optional.
2023-04-23 22:25:24 +02:00
Fabio Manganiello
8e7d444c02
Updated CHANGELOG
2023-04-23 21:19:31 +02:00
Fabio Manganiello
0cd28f1040
libbluetooth-dev is a required dependency to build pybluez on Debian-derived distros
2023-04-23 18:59:37 +02:00
Fabio Manganiello
9c1855e4c0
Fixed docstring for `zigbee.mqtt` plugin.
2023-04-23 13:03:10 +02:00
Fabio Manganiello
0fc05135df
Updated docs
2023-04-23 02:14:57 +02:00
Fabio Manganiello
512ced3e94
Updated dist files
2023-04-23 02:13:48 +02:00
Fabio Manganiello
6439e235d2
Updated caniuse dependency
2023-04-23 02:11:21 +02:00
Fabio Manganiello
27b1048789
Converted `system.processes` to the new data model.
2023-04-23 02:08:43 +02:00
Fabio Manganiello
387616ea96
Convert `system.connected_users` to the new data model.
2023-04-23 01:12:07 +02:00
Fabio Manganiello
259b42bdd6
Removed legacy `backend.sensor.battery`.
2023-04-23 00:44:03 +02:00
Fabio Manganiello
763d9e06ec
Increased default `poll_interval` for `system` plugin to 60 seconds.
2023-04-23 00:42:44 +02:00
Fabio Manganiello
a72c32cb00
Added battery entity support to `system` plugin.
2023-04-23 00:41:21 +02:00
Fabio Manganiello
b3440ab96b
Added support for fan sensors on the `system` plugin.
2023-04-23 00:08:27 +02:00
Fabio Manganiello
45d5f439be
Added support for system temperature sensor entities.
2023-04-22 22:42:11 +02:00
Fabio Manganiello
1b048e1952
s/net_connections/network_connections/g
2023-04-22 17:19:24 +02:00
Fabio Manganiello
374f936c1f
Merged `network_stats` into `NetworkInterface` model.
2023-04-22 17:19:24 +02:00
Fabio Manganiello
f4036be52b
Extracted and refactored more common elements of the Entity components.
2023-04-22 17:19:23 +02:00
Fabio Manganiello
e213941791
s/net_io_counters/network_info/g
2023-04-22 17:19:23 +02:00
Fabio Manganiello
977b55dea9
Merged network addresses into `NetworkInterface` model.
2023-04-22 17:19:23 +02:00
Fabio Manganiello
ebe79ac29a
Refactored system schema dataclasses.
...
- `percent_field` should be declared on `platypush.schemas.dataclasses`
level, since it's not specific to the `system` plugin.
- Added a common `SystemBaseSchema` that takes care of calling
`_asdict()` if the object is passed as a `psutil` object instead of a
dict.
2023-04-22 17:19:23 +02:00
Fabio Manganiello
2d618188c8
Print the full exception stack trace if `.status` fails.
2023-04-22 17:19:23 +02:00
Fabio Manganiello
b3a0896485
Converted `NetworkConnection` schema/response.
2023-04-22 17:19:22 +02:00
Fabio Manganiello
d473b5d836
Make the recursive entity merger/column set logic more resilient against ObjectDeletedError
2023-04-22 10:40:30 +02:00
Fabio Manganiello
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
Fabio Manganiello
44b8fd4b34
Support for `disk` entities in the `system` integration.
2023-04-20 16:26:51 +02:00
Fabio Manganiello
6b03451386
Better responsive alignment for the collapse toggler.
2023-04-20 16:26:05 +02:00
Fabio Manganiello
e8c96ad35d
Added `convertTime` utility function
2023-04-20 02:27:58 +02:00
Fabio Manganiello
153d03d43f
Moved CPU percentage on the level of the CPU entity instead of a child entity.
2023-04-19 01:48:05 +02:00
Fabio Manganiello
4ebfbf3851
Added memory stats entities.
2023-04-19 01:31:11 +02:00
Fabio Manganiello
0073239a40
Support for CPU `load_average` entity.
2023-04-18 18:26:02 +02:00
Fabio Manganiello
1cee0459cf
Added `CpuFrequency` entity to `system`.
2023-04-18 01:49:36 +02:00
Fabio Manganiello
a5b0a524f6
Added `CpuStats` entity to `system`.
2023-04-18 01:19:06 +02:00
Fabio Manganiello
b4fbd3e915
Added `percent` entity to `cpu`.
2023-04-17 02:25:04 +02:00
Fabio Manganiello
711cc2b239
Removed (now unused) `CpuTimesResponse`.
2023-04-17 02:25:03 +02:00
Fabio Manganiello
b9286f50b0
Added support for `CpuTimes` as an entity of the `system` plugin.
...
Also, there is now a single `Cpu` entity being exported, with a nested
hierarchy structured like:
```
cpu
-> cpu_info
-> cpu_times
-> idle
-> user
-> system
-> ...
-> cpu_load
-> ...
```
2023-04-17 02:25:03 +02:00
Fabio Manganiello
4842c1911b
Frontend entities should have a reference to `allEntities`.
...
There are probably more optimal ways of achieving this other than
passing a reference to the full list of entities to each of the
entities, such as running a BFS to recursively expand all the entities
within the child hierarchy of an entity.
This is needed because the entity needs to know which entities aren't
direct children, but are two or more layers down in the hierarchy, so
they should be passed to their own child entities.
2023-04-17 02:25:03 +02:00
Fabio Manganiello
6e65783feb
Added schemas for `CpuTimes`.
2023-04-17 02:25:03 +02:00
Fabio Manganiello
e810025a6d
Added `Cpu` and `CpuTimes` entities.
2023-04-17 02:25:03 +02:00
Fabio Manganiello
65481dc6b4
Added `PercentSensor` entity type.
2023-04-17 02:25:02 +02:00
Fabio Manganiello
e7f64843a5
Added `include_children` parameter to `_merge_columns`.
...
We need to recursively merge the columns of children entities if a child
entity isn't a leaf node.
2023-04-17 02:25:02 +02:00
Fabio Manganiello
b43017ef01
Refactoring the `system` plugin to support entities.
2023-04-17 02:25:02 +02:00
Fabio Manganiello
3e3c48d779
Defined new entity and schema for CpuInfo.
2023-04-17 02:25:02 +02:00
Fabio Manganiello
186a21f715
Added CpuInfo entity frontend components.
2023-04-17 02:25:01 +02:00
Fabio Manganiello
74aeca5c34
Trigger a sensor event only if abs(old_data - new_data) > tolerance
...
Not if abs(old_data - new_data) >= tolerance, otherwise events will
always be triggered when tolerance=0, even if the data hasn't changed.
2023-04-17 02:25:01 +02:00
Fabio Manganiello
4c19535612
A more resilient logic on entity copy/serialization to prevent ObjectDeletedError
2023-04-13 17:16:21 +02:00
Fabio Manganiello
a499b7bc2f
Deprecated `poll_seconds` in `light.hue`.
...
For sake of naming consistency with other plugins, we should use
`poll_interval` instead.
2023-04-03 01:36:12 +02:00
Fabio Manganiello
10955dad72
Fixed some documentation glitches in `switchbot`.
2023-04-03 01:36:12 +02:00
Fabio Manganiello
f9ce4b75e8
Updated docs
2023-04-03 01:36:12 +02:00
Fabio Manganiello
d5de38975d
generate_missing_docs 2.0
2023-04-03 01:36:12 +02:00
Fabio Manganiello
6e5f746dbe
Removed deprecated `gpio.sensor` base plugin.
...
Now all the plugins that used to implement it have been moved to
`SensorPlugin`.
2023-04-03 01:36:12 +02:00
Fabio Manganiello
8852cb8db4
Fixed new class name for `sensor.mcp3008` plugin.
2023-04-03 01:36:12 +02:00
Fabio Manganiello
d5ddc0c65e
Migrated `arduino` integration to the new `SensorPlugin` API.
2023-04-03 01:36:12 +02:00
Fabio Manganiello
cf16076bce
Added icons for new entity sensor sources.
2023-04-03 01:36:11 +02:00
Fabio Manganiello
ac2ec58f89
Migrated `mcp3008` integration to the new `SensorPlugin` API.
2023-04-03 01:36:11 +02:00
Fabio Manganiello
45e5ca47e7
Fallback for sensor._has_changes
2023-04-02 15:38:49 +02:00
Fabio Manganiello
962c55937d
Migrated `sensor.distance` integration.
...
Remove `backend.sensor.distance` and `gpio.sensor.distance`. They are
now replaced by the `sensor.hcsr04` integration, which is compatible
with the new `SensorPlugin` API.
2023-04-02 14:20:12 +02:00
Fabio Manganiello
92578a17c9
Added small docstring portion
2023-04-02 13:55:00 +02:00
Fabio Manganiello
beff88986a
Migrated `dht` integration.
...
Removed `backend.sensor.dht` and `gpio.sensor.dht`. They have been
merged into the new `sensor.dht` integration, which supports the new
`SensorPlugin` API.
2023-04-02 13:38:53 +02:00
Fabio Manganiello
8f604445a2
Migrated old `sensor.accelerometer` integration.
...
Removed `backend.sensor.accelerometer` and `gpio.sensor.accelerometer`.
The logic has now been merged in the new `sensor.lis3dh` integration,
which is compatible with the new `SensorPlugin` API.
2023-04-02 13:22:28 +02:00
Fabio Manganiello
44cf25271c
Migrated `pmw3901` integration.
...
Removed legacy `backend.sensor.motion.pmw3901` and
`gpio.sensor.motion.pmw3901`. They have been merged in the new
`sensor.pmw3901` integration, compatible with the new `SensorPlugin`
API.
2023-04-02 12:36:08 +02:00
Fabio Manganiello
fcdda40c4a
Update the `_last_measurement` only if some events were processed from the new data.
2023-04-02 12:09:45 +02:00
Fabio Manganiello
88784985e1
Should be `abs(old_data - new_data) >= tolerance`.
...
Not `abs(old_data - new_data) > tolerance`.
2023-04-02 12:08:40 +02:00
Fabio Manganiello
a3f4b21478
Updated dist files
2023-04-02 03:24:11 +02:00
Fabio Manganiello
e6e5dec088
Updated dist files
2023-04-02 02:56:09 +02:00
Fabio Manganiello
7697c1c6ad
Migrated `envirophat` to the new `SensorPlugin` API.
...
Removed `backend.sensor.envirophat` and `gpio.sensor.envirophat` plugin.
They have now been merged into the new `sensor.envirophat` plugin.
2023-04-02 02:49:08 +02:00
Fabio Manganiello
3cd42c9e45
`Entity` should use `Message.Encoder` as a JSON serializer.
2023-04-02 02:44:19 +02:00
Fabio Manganiello
31f411868c
`Message.Encoder` should serialize binary data to `0x`-led hex strings.
2023-04-02 02:43:06 +02:00
Fabio Manganiello
9e5ad0e0b1
`Entity.to_dict` now takes into account columns mapped to properties.
...
No more `_value` in the JSON output instead of the `value` property.
If a column is marked as private, and there's an associated property
mapped to its public name, then we should use and serialize that value.
2023-04-02 02:22:40 +02:00
Fabio Manganiello
8d4aa310f4
Support for values passed in dict format to `ThreeAxisSensor`
2023-04-02 02:02:08 +02:00
Fabio Manganiello
5a6f4bcf57
Added 3-axis sensor, accelerometer and magnetometer entities
2023-04-02 01:13:22 +02:00
Fabio Manganiello
d964167631
`s/TimeDurationSensor/TimeDuration/g`
2023-04-02 00:57:48 +02:00
Fabio Manganiello
839c6108a0
Added `sensor.*` icon classes
2023-04-02 00:40:50 +02:00
Fabio Manganiello
429893ddbf
Updated dist files
2023-04-01 23:58:28 +02:00
Fabio Manganiello
f24d0773d1
No need for `sensor.vl53l1x.transform_entities` to call the parent.
2023-04-01 23:54:43 +02:00
Fabio Manganiello
99572f9731
Sanity check to prevent empty objects from being propagated to `sensor.transform_entities`
2023-04-01 23:41:28 +02:00
Fabio Manganiello
3f3726c50a
Fixed another occurrence of "Subscripted generics cannot be used" etc. error
2023-04-01 23:34:22 +02:00
Fabio Manganiello
e2e73d0fdb
Fix another Python < 3.10 subscripted generic issue.
2023-04-01 23:23:51 +02:00
Fabio Manganiello
c1d0f21ead
Migrated `ltr559` integration to the new API.
...
Merged `backend.sensor.ltr559` and `gpio.sensor.ltr559` into the new
`sensor.ltr559` plugin, which extends the new `SensorPlugin` API.
2023-04-01 23:16:03 +02:00
Fabio Manganiello
8e0f88ea16
Don't swap the argument of `SensorPlugin.publish_entities` with a list if not required
2023-04-01 23:06:37 +02:00
Fabio Manganiello
0047d85b9d
Dirty fix for "Subscripted generics cannot be used with class and instance checks" on Python < 3.10
2023-04-01 22:52:24 +02:00
Fabio Manganiello
98ec018292
Replaced `NoneType` reference.
...
`types.NoneType` is not always available on all Python versions, so we
have to make our own type for it.
2023-04-01 22:42:13 +02:00
Fabio Manganiello
5dabfed365
Migrated `sensor.bme280` to the new `SensorPlugin` interface.
...
Removed the old `backend.sensor.bme280` and the old `gpio.sensor.bme280`
plugin. They have now been merged into the new `sensor.bme280` runnable
plugin, which extends the `SensorPlugin` API and supports entities.
2023-04-01 22:31:24 +02:00
Fabio Manganiello
6f237a1500
Support the deprecated `poll_seconds` option on `RunnablePlugin`
2023-04-01 22:02:59 +02:00
Fabio Manganiello
c23e8867e2
Added `enabled_sensors` to the `sensor` plugin
2023-04-01 21:56:56 +02:00
Fabio Manganiello
7912a59ff8
`vl53l1x` plugin migrated to the new `SensorPlugin` interface.
2023-04-01 19:31:13 +02:00
Fabio Manganiello
6a5a5de03e
`serial` plugin migrated to the new `SensorPlugin` interface.
2023-04-01 19:29:56 +02:00
Fabio Manganiello
bf4db76830
Legacy `sensor` backend replaced by an extended `sensor` runnable plugin.
2023-04-01 19:24:35 +02:00
Fabio Manganiello
bf75eb73ac
Added an abstract base `SensorDataEvent` for sensor events.
2023-03-31 22:51:35 +02:00
Fabio Manganiello
6a3ade3304
Added `common.sensors` package.
...
The package contains the base types and constants shared across
sensor-based integrations.
2023-03-31 22:50:47 +02:00
Fabio Manganiello
42d468c895
`get_lock` should raise a TimeoutError if `lock.acquire` is False
2023-03-31 22:31:32 +02:00
Fabio Manganiello
9693becb9e
Removed LGTM badges from the README.
...
LGTM is now merged into Github and the badges are no longer available.
2023-03-31 14:31:45 +02:00
Fabio Manganiello
7bdd877e49
Support the `binary` flag both on `serial.read` and `serial.write`.
2023-03-31 14:31:45 +02:00
Fabio Manganiello
1efaff878e
Rewritten `serial` plugin.
...
`backend.serial` has been removed and the polling logic merged into the
`serial` plugin.
The `serial` plugin now supports the new entity engine as well.
2023-03-31 14:31:45 +02:00
Fabio Manganiello
4f15758de9
black fixes
2023-03-31 14:31:38 +02:00
Fabio Manganiello
2a8a3f4394
Removed legacy sensor.distance.vl53l1x backend
2023-03-31 14:26:14 +02:00
Fabio Manganiello
a3e8c7c155
Rewritten vl53l1x integration as a runnable plugin with entity support
2023-03-31 14:25:05 +02:00
Fabio Manganiello
226034946f
Added `distance_sensor` entity
2023-03-31 14:22:28 +02:00
Fabio Manganiello
6fb362a6fb
gpio.sensor.distance.vl53l1x -> sensor.distance.vl53l1x
2023-03-31 14:21:48 +02:00
Fabio Manganiello
e198f2a175
Replaced `.title` in `get_plugin` with `.upper` on the first character.
...
`str.title` capitalizes any alphabetic letter after any non-alphabetic
letter. That's a problem for Platypush plugins' naming convention,
because plugins like `sensor.distance.vl53l1x` may be broken into
`sensor.distance.vl53.l1.x`.
2023-03-31 14:09:43 +02:00
Fabio Manganiello
c2f9ebf4ed
Updated dist files
2023-03-27 01:47:29 +02:00
Fabio Manganiello
2781eb1fb1
Merge branch 'master' into 29-generic-entities-support
2023-03-27 00:36:50 +02:00
Fabio Manganiello
792a65df8b
Merge pull request '[ #240 ] Migrated `clipboard` plugin from `pyperclip` to `pyclip`' ( #241 ) from 240-migrate-clipboard-integration-to-pyclip into master
...
Reviewed-on: platypush/platypush#241
2023-03-26 23:56:51 +02:00
Fabio Manganiello
7a368ebbb8
[ #240 ] Migrated `clipboard` plugin from `pyperclip` to `pyclip`.
...
Closes : #240
2023-03-26 23:52:15 +02:00
Fabio Manganiello
bce2fdee25
Replaced deprecated `asyncio.wait([])` with `asyncio.gather(*[])`.
2023-03-26 23:15:53 +02:00
Fabio Manganiello
cf91ab90df
Increased default width of `nav` on desktop+
2023-03-26 23:10:46 +02:00
Fabio Manganiello
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
Fabio Manganiello
efe400f921
Fixed `maxdepth` attribute in generate docs.
2023-03-26 22:55:22 +02:00
Fabio Manganiello
6d674fef21
Fixed small JSON syntax error in the docstring of `ntfy.send_message`.
2023-03-26 22:53:42 +02:00
Fabio Manganiello
30124e7cef
Fixed docstring of `Event.__init__`.
2023-03-26 22:53:11 +02:00
Fabio Manganiello
276aff757b
Removed circular dependency.
...
Workaround for the circular dependency between
`platypush.entities.bluetooth` and `platypush.plugins.bluetooth.model`.
Unentangling the circular dependency would require way too much work,
since the entity model provides several helpers and properties that
depend on the plugin's model.
The workaround in this commit is to simply push those imports down in
the methods that use them, so they won't be imported until those methods
are called, as well as removing some type annotations that depended on
those objects.
2023-03-26 15:30:57 +02:00
Fabio Manganiello
3bb2336b3a
Updated docs
2023-03-26 15:13:48 +02:00
Fabio Manganiello
89bc54da22
Updated dist files
2023-03-26 12:30:46 +02:00
Fabio Manganiello
295758bb20
Added frontend components for cloud instances.
2023-03-26 12:27:17 +02:00
Fabio Manganiello
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
Fabio Manganiello
4b9c5a0203
Support for schema `EnumField`.
2023-03-26 03:48:32 +02:00
Fabio Manganiello
026662f6b6
Added base schema for Marshmallow dataclasses.
2023-03-26 03:47:44 +02:00
Fabio Manganiello
7bbae55e44
`platypush.entities._managers` -> `platypush.entities.managers`.
...
It's better for entity managers to be stored in their own public
package, instead of cluttering too much the namespace of their parent
package.
2023-03-26 03:46:06 +02:00
Fabio Manganiello
f5d9895521
Added `marshmallow_dataclass` to the requirements.
2023-03-26 03:44:57 +02:00
Fabio Manganiello
89d85baa6d
Support for implicit serialization of Enum values in JSONAble.
2023-03-26 03:43:04 +02:00
Fabio Manganiello
a71017df33
Updated web app files
2023-03-24 16:45:55 +01:00
Fabio Manganiello
567e9d4e21
Removed legacy `bluetooth` backends.
...
No replacements have been made for the OBEX backends (push and file
services). PyOBEX is too broken and unmaintained, and there are too many
poorly documented steps required to get an unprivileged user to run an
SDP service.
2023-03-24 16:41:30 +01:00
Fabio Manganiello
3c355352c5
Using the new `StoppableThread` API.
2023-03-24 16:39:30 +01:00
Fabio Manganiello
5ebf4e912e
Added `wait_stop` and `shoud_stop` methods to `StoppableThread`.
2023-03-24 16:05:18 +01:00
Fabio Manganiello
998793e94f
Added `OBEX_FILE_TRANSFER` constant to `directory` stub.
2023-03-24 15:41:20 +01:00
Fabio Manganiello
4b4db5b3c7
Added `StoppableThread` common interface.
2023-03-24 15:40:16 +01:00
Fabio Manganiello
2f49ddf33a
Fallback logic that uses DBus to disconnect from a BT device.
...
This logic will be used if the connection wasn't opened by the current
process and therefore a call to DBus is required to terminate it.
2023-03-24 01:57:05 +01:00
Fabio Manganiello
913ef6f8cd
Refresh `BluetoothDevice.reachable` when a device is found/lost.
2023-03-24 01:56:19 +01:00
Fabio Manganiello
d46d4e2300
Added support for Bluetooth devices blacklist.
...
Based on device address, name or manufacturer.
2023-03-24 01:52:39 +01:00
Fabio Manganiello
0cebcf4f9b
`switchbot.bluetooth` integration migrated to a `bluetooth` plugin.
2023-03-23 17:46:54 +01:00
Fabio Manganiello
4fac110bb8
Added `bluetooth.set` method, whose execution is delegated to the plugins.
2023-03-23 17:45:02 +01:00
Fabio Manganiello
cd219f44c4
Pass the list of plugins when creating Bluetooth managers.
2023-03-23 17:42:16 +01:00
Fabio Manganiello
43289a3b55
Scan always at least for 10 seconds before failing on `get_device`.
2023-03-23 17:41:37 +01:00
Fabio Manganiello
6267943786
Wrap `BleakError` exceptions into `AssertionError`.
2023-03-23 17:40:30 +01:00
Fabio Manganiello
d6805a8b18
Added support for custom Bluetooth device plugins.
2023-03-23 17:10:37 +01:00
Fabio Manganiello
af125347d6
If no matching services are found when connecting to a device, default to BLEManager.
...
GATT characteristics are not necessarily exposed as services.
2023-03-23 13:00:26 +01:00
Fabio Manganiello
d1cd6dd2af
get_plugin with reload=True should stop the existing plugin if it's running
2023-03-23 01:11:54 +01:00
Fabio Manganiello
a2a5fce6cb
Added `Apple Continuity` to the list of blacklisted manufacturers/models
2023-03-22 22:55:19 +01:00
Fabio Manganiello
e71c312133
Always read an entity's parent through get_parent when climbing up.
...
This should avoid the risk of `DetachedInstanceError` by retrieving the
object into the session if it's not available.
2023-03-22 22:41:09 +01:00
Fabio Manganiello
5c23d3aa87
metadata and rssi fields on BLEDevice have been deprecated.
...
Changed the BLE beacon parsing logic to read those fields from
`AdvertisementData` instead of `BLEDevice`.
2023-03-22 22:39:01 +01:00
Fabio Manganiello
65bc3ae06d
Noisy beacons device configuration should look both at manufacturer and model.
2023-03-22 22:37:46 +01:00
Fabio Manganiello
f49b866a51
Focus the <input> element when a <NameEditor> element is created.
2023-03-22 21:28:21 +01:00
Fabio Manganiello
dd80dc998c
Show entity icon and type in the list of children entities on EntityModal.
2023-03-22 21:26:59 +01:00
Fabio Manganiello
239dd17f23
Exclude from the list of display children on EntityModal those with no name or that are configuration values.
2023-03-22 16:38:38 +01:00
Fabio Manganiello
e10bec88c0
Noisy beacons logging trace moved from info to debug.
2023-03-22 16:31:57 +01:00
Fabio Manganiello
5dd95362a1
Include links both to the parent and children entities in EntityModal.
2023-03-22 16:20:29 +01:00
Fabio Manganiello
99cfd247a5
A more effective logic to exclude noisy BLE beacons.
...
This includes BLE beacons sent from all Google/Apple/Microsoft/Samsung
beacon networks in all of their variants.
2023-03-22 15:35:02 +01:00
Fabio Manganiello
01d323fad0
Passing a boolean `exclude_known_noisy_beacons` to `bluetooth` plugin.
...
The logic to exclude BLE beacons from randomized devices needs to be a
bit more granular and not limited only to the reported device
manufacturer.
2023-03-22 15:29:19 +01:00
Fabio Manganiello
f6e09d34e4
A more clever logic of parsing the manufacturer for BLE devices.
...
1. Check the manufacturer parsed via Bleak/Theengs
2. Check the MAC address prefix in the oui numbers table
3. Check from the reported `manufacturer_data`
2023-03-22 14:16:00 +01:00
Fabio Manganiello
f7e8cfe5a7
Don't include `unit` in BLE sensors when they are matched against the native type.
...
It's likely to just include the native type name anyway.
2023-03-22 14:14:59 +01:00
Fabio Manganiello
486f37a45e
Support sensor value reported both on `value` as well as `_value` fields.
2023-03-22 14:11:13 +01:00
Fabio Manganiello
bfc87e0f7b
Display arrays and objects in the entity modal as prettified JSON.
2023-03-22 13:50:35 +01:00
Fabio Manganiello
c750d83188
Prevent name collisions on `bluetooth.ServiceClass`.
2023-03-22 03:27:25 +01:00
Fabio Manganiello
174b1ee6a9
Use a default list of excluded Bluetooth manufacturers.
2023-03-21 16:03:01 +01:00
Fabio Manganiello
e9abb5cb9a
Implemented support for child entities in entity modals.
2023-03-21 16:02:02 +01:00
Fabio Manganiello
b1cb7ef847
Added a list of `excluded_manufacturers` to `BluetoothPlugin`.
2023-03-21 14:32:45 +01:00
Fabio Manganiello
718e0434ba
Display all available entity attributes on EntityModal.
2023-03-20 14:32:03 +01:00
Fabio Manganiello
78bbe71be1
Another .pull-right fix.
2023-03-20 02:04:32 +01:00
Fabio Manganiello
3743ee4f00
s/TheengsGateway/TheengsDecoder/g now that the pip package has been published.
2023-03-20 01:41:21 +01:00
Fabio Manganiello
431dedf3eb
BluetoothDevice moved to its own component, with device connect support.
2023-03-20 01:28:12 +01:00
Fabio Manganiello
0a4b22c12e
Implemented connect/disconnect call on BluetoothService component.
2023-03-20 01:27:47 +01:00
Fabio Manganiello
714f853751
Pass the list of children to the entity component.
2023-03-20 01:27:21 +01:00
Fabio Manganiello
a011de890b
Better .pull-right class implementation.
2023-03-20 01:26:48 +01:00
Fabio Manganiello
2b5596820b
Made Types.objectsEqual method more robust against null input
2023-03-19 22:50:23 +01:00
Fabio Manganiello
71a3481560
Better style for the sidebar/nav
2023-03-19 22:23:37 +01:00
Fabio Manganiello
12096f2dbe
Don't fail hard when device disconnection fails.
2023-03-19 12:56:53 +01:00
Fabio Manganiello
40f81b105f
Set the connected flag when connecting/disconnecting from a service.
2023-03-19 12:56:31 +01:00
Fabio Manganiello
9d66b63266
BluetoothService attributes fixes.
...
BluetoothService IDs should always be in the format `address::uuid` and
the name should always be in title format.
2023-03-19 12:55:14 +01:00
Fabio Manganiello
6e9263c4e4
A more elegant logic to infer the manufacturer name.
2023-03-19 12:54:52 +01:00
Fabio Manganiello
b568876474
Use a service's UUID as a name instead of Unknown if the service is unknown.
2023-03-19 12:54:09 +01:00
Fabio Manganiello
aa04741daa
Added BluetoothService UI component
2023-03-19 12:53:23 +01:00
Fabio Manganiello
f74fab795d
Added `parent` component value to `Entity`.
2023-03-19 12:50:45 +01:00
Fabio Manganiello
243de15813
Added `connected` flag to `BluetoothService`.
2023-03-19 12:49:38 +01:00
Fabio Manganiello
256d9adbf2
Removed `children` from `BluetoothDevice.to_json` - it makes events too verbose
2023-03-19 12:48:11 +01:00
Fabio Manganiello
4144e4f842
Fixed self._ip_to_dev expansion
2023-03-19 12:47:07 +01:00
Fabio Manganiello
878fe91155
Big rewrite/refactor of the entities merger
2023-03-19 12:40:48 +01:00
Fabio Manganiello
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
Fabio Manganiello
4bc61133c5
The Entity object should also have a `to_json` method.
2023-03-12 23:01:51 +01:00
Fabio Manganiello
4a8da80c7c
Don't join self._thread on stop in RunnablePlugin if self._thread = current_thread
2023-03-11 23:45:46 +01:00
Fabio Manganiello
31552963c4
`EntitiesDb.upsert` should return a deep copy of the upserted entities.
...
Not the upserted entities themselves, no matter if expunged or made transient.
Reminder to my future self: returning the flushed entities and then using them
outside of the session or in another thread opens a big can of worms when using
SQLAlchemy.
2023-03-10 12:06:36 +01:00
Fabio Manganiello
f45e47363d
Use lazy='joined' instead of lazy='selectin' on Entity.parent.
...
That's the best way to ensure that all the columns are fetched eagerly and
prevent errors later when trying to access lazily loaded attributes outside
of the session/thread.
2023-03-10 12:01:23 +01:00
Fabio Manganiello
8ccf3e804d
Added utility get_entities_engine() function.
2023-03-10 11:49:23 +01:00
Fabio Manganiello
60da930e4b
Added support for get_plugin(MyPlugin) besides get_plugin('my').
2023-03-10 11:47:39 +01:00
Fabio Manganiello
3fcc9957d1
A dirty fix to prevent DetachedInstanceError when accessing the parent entity.
2023-03-10 11:45:44 +01:00
Fabio Manganiello
ceb7a2f098
EntitiesEngine synchronization improvements.
...
- Added `wait_start()` method that other threads can use to synchronize
with the engine and wait before performing db operations.
- Callback logic wrapped in a try/except block to prevent custom
integrations with buggy callbacks from crashing the engine.
2023-03-10 00:57:24 +01:00
Fabio Manganiello
73dc2463f1
Added auto_commit=False to entities.save()
2023-03-10 00:40:51 +01:00
Fabio Manganiello
7e92d5f244
Added recursive `.copy()` method to `Entity`.
2023-03-09 22:35:31 +01:00
Fabio Manganiello
9f9ee575f1
Added _import_error_ignored_modules.
...
ImportErrors on these entity modules will be ignored when dynamically
loading them, since they have optional external dependencies and we
shouldn't throw an error if we can't import them.
2023-03-09 01:40:35 +01:00
Fabio Manganiello
c4efec6832
Several fixes and improvements on the entities engine.
...
- Support for an optional callback on `publish_entities` to get notified
when the published object are flushed to the db.
- Use `lazy='selectin'` for the entity parent -> children relationship -
it is more efficient and it ensures that all the data the application
needs is loaded upfront.
- `Entity.entity_key` rolled back to `<external_id, plugin>`. The
fallback logic on `<id, plugin>` created more problems than those it
as supposed to solve.
- Added `expire_on_commit=False` to the entities engine session to make
sure that we don't get errors on detached/expired instances.
2023-03-09 01:16:04 +01:00
Fabio Manganiello
1781a19a79
s/Entity.to_json/Entity.to_dict/g
...
stuff
2023-03-06 23:46:33 +01:00
Fabio Manganiello
b9efa9fa30
entity_key should coalesce (entity.external_id or entity.id)
2023-03-06 16:54:02 +01:00
Fabio Manganiello
72c55c03f2
[WIP] Refactoring/extending models and parsers for Bluetooth entities.
2023-03-03 02:10:11 +01:00
Fabio Manganiello
a688e7102e
Changed default `poll_interval` for `RunnablePlugin`.
...
30 -> 15 seconds.
2023-03-03 02:00:48 +01:00
Fabio Manganiello
ead4513915
Added optional `unit` column to `RawSensor` entity.
2023-03-03 01:59:27 +01:00
Fabio Manganiello
94c4e52154
Mock PyOBEX.client in readthedocs conf.py
2023-03-03 01:58:32 +01:00
Fabio Manganiello
7be55e446f
Convert UUID objects to strings when serializing to JSON.
2023-03-02 21:58:26 +01:00
Fabio Manganiello
15fadb93bb
Added stand-alone `connect` and `disconnect` actions to `bluetooth`.
2023-02-25 01:59:35 +01:00
Fabio Manganiello
70d1bb893c
A cleaner way of calculating the `success` response attribute.
2023-02-25 01:58:09 +01:00
Fabio Manganiello
2dfb389630
Added remaining `bluetooth` entity types in `_mappers.py`.
2023-02-23 21:20:41 +01:00
Fabio Manganiello
a0556d3a42
Added `PresenceSensor` entities.
2023-02-23 01:42:26 +01:00
Fabio Manganiello
886b930e2f
Support for `bluetooth` devices with multiple temperature sensors.
2023-02-23 01:27:31 +01:00
Fabio Manganiello
56d693032a
Added `DewPointSensor` entities.
2023-02-23 01:23:04 +01:00
Fabio Manganiello
d212276247
Added `PressureSensor` entities.
2023-02-23 01:12:27 +01:00
Fabio Manganiello
dd3f683006
Added `unit` to `bluetooth` mappers whenever available.
2023-02-23 01:04:33 +01:00
Fabio Manganiello
d961e2a997
Added `TimeDurationSensor` entity.
2023-02-23 01:02:13 +01:00
Fabio Manganiello
c3e16f9f9d
Added support for heart rate sensor entities.
2023-02-23 00:55:55 +01:00
Fabio Manganiello
3dab94c346
Added `StepsSensor` detection to `bluetooth`.
2023-02-23 00:50:06 +01:00
Fabio Manganiello
e1b3d52706
Added `StepsSensor` entity.
2023-02-23 00:45:58 +01:00
Fabio Manganiello
dcab766cef
Only scan for the configured Bluetooth service UUIDs.
2023-02-22 03:36:16 +01:00
Fabio Manganiello
d8c429f4a8
Major improvements on the entities engine.
...
- Better logic to recursively link parent/children entities, so partial
updates won't get lost.
- Removed `EntitiesCache` - it was too much to maintain while keeping
consistent with the ORM, and it was a perennial fight against
SQLAlchemy's own cache.
- Removed `EntityNotifier` - with no need to merge cached entities, the
`notify` method has become much simpler and it's simply been merged
in the `EntitiesRepository`.
2023-02-22 02:53:45 +01:00
Fabio Manganiello
9776921836
Better way of handling with `RawSensor` in `bluetooth` integration.
2023-02-22 02:26:51 +01:00
Fabio Manganiello
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
Fabio Manganiello
dc7cbe743d
Refactored/improved `RawSensor` entity.
...
It will now automatically deal with most of the native types and convert
them to strings on the db.
2023-02-22 02:19:19 +01:00
Fabio Manganiello
b2ffc08c89
s/MultiValueSensor/CompositeSensor/g on `smartthings`
2023-02-22 02:18:12 +01:00
Fabio Manganiello
340fd08064
Removed some old `type: ignore` comments.
2023-02-22 01:29:51 +01:00
Fabio Manganiello
cf219d5a48
Added some more docstrings to entities.
2023-02-22 01:02:26 +01:00
Fabio Manganiello
7fa545d7f8
Merge branch 'master' into 29-generic-entities-support
2023-02-22 00:46:33 +01:00
Fabio Manganiello
c645ce6bb8
Bump version: 0.24.4 → 0.24.5
2023-02-22 00:32:57 +01:00
Fabio Manganiello
2b8a5fee88
Updated CHANGELOG
2023-02-22 00:32:39 +01:00
Fabio Manganiello
26d9aaa5b1
(Temporarily) specify `sqlalchemy<2.0.0`.
...
SQLAlchemy 2 has introduced several breaking changes that can break
several things in the application - especially where the code uses
`connection.execute()` with raw SQL statements.
We need to temporarily force the installation of versions from the 1.x
branch, while migrating the existing code to the new version.
2023-02-22 00:25:57 +01:00
Fabio Manganiello
bbc9647cb0
s/MultiValueSensor/CompositeSensor/g
2023-02-21 23:14:10 +01:00
Fabio Manganiello
2fa45fc5a3
Documentation and LINT fixes for sensor entities.
2023-02-21 23:10:05 +01:00
Fabio Manganiello
b4627ecd04
Removed deprecated use_unicode parameter from MPDClient
2023-02-20 20:35:33 +01:00
Fabio Manganiello
aa0b909fff
Use the TheengsDecoder to parse Bluetooth packets and map services to native entities.
2023-02-20 20:27:17 +01:00
Fabio Manganiello
73bf2446bd
Wrap `bluetooth.connect` in a per-device locked section.
2023-02-19 23:11:19 +01:00
Fabio Manganiello
9112239ac3
Better exception management in `AsyncRunnablePlugin`.
...
Exceptions that cause the termination of the plugin's loop should always
be logged as such, unless the plugin is supposed to stop and various
exceptions may occur upon teardown.
2023-02-19 23:03:27 +01:00
Fabio Manganiello
a6c36fa1c1
Added brand, model and model_id columns to `BluetoothDevice`.
2023-02-19 23:02:04 +01:00
Fabio Manganiello
68e6b271c1
Updated dist files
2023-02-19 22:58:20 +01:00
Fabio Manganiello
cb9b01c89f
Added raw_sensor metadata
2023-02-19 22:57:50 +01:00
Fabio Manganiello
72a9a9dfcf
LINT/type fixes
2023-02-19 22:56:45 +01:00
Fabio Manganiello
8aedc3c233
Recursively normalize child entities in `EntityManager._normalize_entities`
2023-02-18 17:51:57 +01:00
Fabio Manganiello
613e32e7c1
Extended number of supported events and data fields in Bluetooth integration.
2023-02-18 01:15:10 +01:00
Fabio Manganiello
7adae272a4
Merge branch 'master' into 29-generic-entities-support
2023-02-15 22:24:41 +01:00
Fabio Manganiello
08553f84b9
Added `timeout` parameter to `websocket.send`.
2023-02-15 22:23:15 +01:00
Fabio Manganiello
45664be44b
Removed deprecated `backend.bluetooth.scanner`.
...
Scan capabilities are now implemented on the `bluetooth` plugin itself.
2023-02-13 23:13:51 +01:00
Fabio Manganiello
471bc1fd3d
Updated dist files
2023-02-13 23:13:32 +01:00
Fabio Manganiello
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
Fabio Manganiello
1d0be5c929
- Simplified prototype for `EntityManager.set`
...
- Added small documentation/annotations notes to the `Plugin` module.
- Small LINT fixes
2023-02-11 21:35:00 +01:00
Fabio Manganiello
575635fd6b
Defined `set` as a base method for all plugins that implement writeable entities
2023-02-11 04:04:21 +01:00
Fabio Manganiello
4365352331
[WIP] s/set_value/set/g for entities
2023-02-11 03:57:23 +01:00
Fabio Manganiello
b0cc80ceb0
Rewriting `bluetooth.ble` plugin to use `bleak` instead of `gattlib`.
2023-02-10 17:40:20 +01:00
Fabio Manganiello
f30e077a5a
Support for custom Bluetooth adapter on `switchbot.bluetooth`.
2023-02-08 23:01:05 +01:00
Fabio Manganiello
8469a1027f
Migrated/refactored `switchbot.bluetooth` integration.
...
- Out `gattlib` + `pybluez`, in `bleak`. It's not platform-dependent, it doesn't
require libboost and other heavy build dependencies, and it doesn't require the
user that runs the service from having special privileges to access raw
Bluetooth sockets.
- Better integration with Platypush native entities. The devices are now mapped
to write-only `EnumSwitch` entities, and the status returns the serialized
representation of those entities instead of the previous intermediate
representation.
2023-02-08 22:42:00 +01:00
Fabio Manganiello
35719b0da9
Let `publish_entities` return the list of transformed_entities
2023-02-08 02:09:34 +01:00
Fabio Manganiello
e04870209e
More LINT fixes
2023-02-08 01:50:54 +01:00
Fabio Manganiello
a98a5f0980
typo fix
2023-02-08 01:09:25 +01:00
Fabio Manganiello
e49a0aec4d
Various improvements.
...
- Better synchronization logic on stop for `AsyncRunnablePlugin`.
- Fixed several thread names by dropping `prctl.set_name` in favour of
specifying the name directly on thread creation.
- Several LINT fixes.
2023-02-08 00:46:50 +01:00
Fabio Manganiello
9d028af524
Removed last reference of `SwitchPlugin`
2023-02-05 23:10:35 +01:00
Fabio Manganiello
419a0cec61
More LINTing
...
Better prototype for `MultiLevelSwitchEntityManager.set_value`
2023-02-05 23:07:43 +01:00
Fabio Manganiello
fde834c1b1
More LINT fixes + refactors
2023-02-05 22:00:50 +01:00
Fabio Manganiello
4849e14414
LINT fixes for the `utils` module + additional documentation
2023-02-05 18:05:41 +01:00
Fabio Manganiello
b8fca97891
Default poll_interval for `RunnablePlugin` set to 30 seconds
2023-02-05 17:31:43 +01:00
Fabio Manganiello
06dfd1a152
Added support for more entities in `switchbot`
2023-02-05 15:34:50 +01:00
Fabio Manganiello
64e9bf17cf
Updated dist files
2023-02-05 14:53:36 +01:00
Fabio Manganiello
2047b9b76c
[WIP] Refactoring `switchbot` plugin as a runnable plugin + entity manager
2023-02-04 22:22:51 +01:00
Fabio Manganiello
65827aa0cd
Updated dist files
2023-02-04 17:36:46 +01:00
Fabio Manganiello
b96838a856
Major LINT fixes/refactor for the `Config` class
2023-02-04 17:35:48 +01:00
Fabio Manganiello
db5846d296
Add the unit to the `Dimmer` display value if it's available
2023-02-04 17:28:54 +01:00
Fabio Manganiello
0311d87bc3
The `switch.wemo` integration now extends `SwitchEntityManager`
2023-02-04 00:58:28 +01:00
Fabio Manganiello
de2849546a
LINT fixes
2023-02-04 00:26:48 +01:00
Fabio Manganiello
a160d3217e
Removed legacy `get_sensor_plugins` and `get_switch_plugins` actions
2023-02-03 22:54:42 +01:00
Fabio Manganiello
a8fcbef1b5
gitignore
2023-02-03 22:49:50 +01:00
Fabio Manganiello
b6814b4f16
Removed legacy Switches integration [frontend]
2023-02-03 22:49:09 +01:00
Fabio Manganiello
6ef2feea71
LINT fixes for `utils` plugin
2023-02-03 18:08:19 +01:00
Fabio Manganiello
3db9c58d31
[WIP] Converted `switch.tplink` plugin.
...
`switch.tplink` converted to a `RunnablePlugin` that implements
`SwitchEntityManager`.
2023-02-03 02:20:20 +01:00
Fabio Manganiello
be3b99326f
[WIP] Refactoring `@manages` annotation into a proper `EntityManager` hierarchy
2023-02-02 23:21:12 +01:00
Fabio Manganiello
63d6920716
Updated dist files
2023-02-02 18:07:44 +01:00
Fabio Manganiello
59eb0742a1
s/warnings/logger.debug/ if publish_entities is called with no engine registered
2023-01-29 21:52:12 +01:00
Fabio Manganiello
8aff181956
Merged `zwave.mqtt` backend into the `zwave.mqtt` plugin
2023-01-29 02:34:48 +01:00
Fabio Manganiello
0e56d0fff6
Double-check if self._thread != None on stop on the ntfy thread
...
Race conditions may occur here
2023-01-27 22:12:34 +01:00
Fabio Manganiello
341e749d23
Merged the `zigbee.mqtt` backend into the plugin.
...
- Deprecated the old `zigbee.mqtt` backend
- Black style for the `mqtt` backend
2023-01-27 01:59:57 +01:00
Fabio Manganiello
afdeb91f66
Implemented remaining supported entities for the `smartthings` integration
2023-01-26 22:10:02 +01:00
Fabio Manganiello
334ccc35a2
Don't serialize I/O wrappers
...
This removes warnings on `config.get`, where the `logging` configuration
key may also contain the current logging stream and we end up with a
JSONDecodeError when trying to serialize it.
2023-01-25 00:52:37 +01:00
Fabio Manganiello
ba31dff06a
Major refactor + fixes for `smartthings`
2023-01-24 23:56:28 +01:00
Fabio Manganiello
147f36c86c
All `Sensor` instances should have `is_read_only=True` by default
2023-01-22 21:05:14 +01:00
Fabio Manganiello
fd76642082
Added `Volume` and `Muted` entities
2023-01-22 21:04:46 +01:00
Fabio Manganiello
bb637a1411
Defined a unique `stop_timeout` (default=5) for RunnablePlugin
2023-01-22 14:28:16 +01:00
Fabio Manganiello
6d4cf64253
More work on `smartthings`.
...
- Added support for `Battery` entities
- Fixed saturation range for `Light` entities
- Parsing `min`/`max`/`unit` from the status attributes, if available
2023-01-22 01:01:47 +01:00
Fabio Manganiello
ddd516a677
Added polling/RunnablePlugin logic to `smartthings`
2023-01-22 00:09:10 +01:00
Fabio Manganiello
dabbe031ab
Don't show the entity modal unless the user clicks on the name or icon
2023-01-21 23:46:38 +01:00
Fabio Manganiello
32e4e60579
A more robust handling of events in the `zwave.mqtt` backend
2023-01-21 23:44:51 +01:00
Fabio Manganiello
3940288396
Use the new bus notification helpers
2023-01-21 16:59:18 +01:00
Fabio Manganiello
241670c9d0
Handle parent/child update events through broadcast bus events
2023-01-21 16:58:28 +01:00
Fabio Manganiello
3923a09831
- Expose methods on the bus module to publish/subscribe to notifications and entity updates
...
- Removed some redundant `pass` statements in Z-Wave derived event classes
2023-01-21 16:56:27 +01:00
Fabio Manganiello
fb562bb415
Propagate the @update event to the parent entities
2023-01-21 14:55:06 +01:00
Fabio Manganiello
4d762b81dc
EntityUpdateEvent traces can now be logged on INFO level
...
The EntityUpdateEvents generated by light.hue are now less noisy.
2023-01-21 14:50:05 +01:00
Fabio Manganiello
247912799f
Refactored light.hue integration so EntityUpdateEvents won't be triggered on every call to _get_lights
2023-01-21 14:48:33 +01:00
Fabio Manganiello
dfb13127ee
Added MotionSensor entities
2023-01-21 14:47:18 +01:00
Fabio Manganiello
a892bad34c
Refactoring smartthings plugin to support more entity types
2023-01-21 14:09:26 +01:00
Fabio Manganiello
22b8b03cb2
Refactored EntityIcon component
2023-01-15 20:02:50 +01:00
Fabio Manganiello
9a5e2899e8
Support for external_url and image_url on entities
2023-01-15 20:01:47 +01:00
Fabio Manganiello
2cc5e3f726
UI tweaks
2023-01-15 15:46:25 +01:00
Fabio Manganiello
9e4fbc6a21
Defined the collapsed data property on EntityMixin level
2023-01-15 15:29:26 +01:00
Fabio Manganiello
78e250186b
Deallocate the color converter when the light component is unmounted
2023-01-15 15:25:04 +01:00
Fabio Manganiello
e9371ac5d0
Improved entity collapse logic
...
- Toggle collapsed state also if clicked on the gap between the entity
name and the right edge, instead of opening the entity modal. The
entity configuration modal should open only when clicking on the
entity name or icon (and these should be highlighted on hover as links
as well).
- The collapsed state update should be propagated to the wrapped
component as well, if applicable.
2023-01-15 15:03:53 +01:00
Fabio Manganiello
dbf5ed3b85
s/expanded/collapsed/g (for naming consistency)
2023-01-15 14:26:44 +01:00
Fabio Manganiello
bb483fd1b1
Using a nice gradient for hover-bg
2023-01-15 12:34:18 +01:00
Fabio Manganiello
cda03887d4
Updated dist files
2023-01-15 12:34:02 +01:00
Fabio Manganiello
9df4d5b5b8
Zigbee entities should be marked as unreachable also if they are currently being interviewed
2023-01-14 22:35:17 +01:00
Fabio Manganiello
afd9a1d6bf
Don't load entities that only have non-queriable children
2023-01-14 22:33:53 +01:00
Fabio Manganiello
2778357a9e
Wrapped dynamic Vue components in shallowRef.
...
The performance of the page is heavily degraded by components loaded
dynamically via defineAsyncComponent that recursively carry behind the
whole Vue machinery.
By wrapping defineAsyncComponent calls in shallowRef we make sure that
we only wire the root level of the newly created dynamic component.
2023-01-14 22:31:48 +01:00
Fabio Manganiello
fd2d83c80b
Renamed Notification mixin's warn and error methods.
...
Renamed to `notifyWarning` and `notifyError` respectively.
Those names can often clash with other properties defined on components
that extend the mixin (like entities).
2023-01-14 22:27:43 +01:00
Fabio Manganiello
aa22507f50
DropdownItem.className should not be enforced to be a string.
...
It can also be a class -> boolean object.
2023-01-14 22:11:05 +01:00
Fabio Manganiello
a58caa17e2
Decreased time of EventQueue (2 -> 1 second) to make entity events more responsive
2023-01-13 23:28:58 +01:00
Fabio Manganiello
68497e6388
Normalize the light devices' IEEE addresses before retrieving the associated devices
2023-01-13 23:28:12 +01:00
Fabio Manganiello
22a566a88b
More refactors and fixes for `zigbee.mqtt`
2023-01-13 02:58:47 +01:00
Fabio Manganiello
38438230d7
The batch of entities currently being processed should have no duplicate keys
2023-01-11 01:22:56 +01:00
Fabio Manganiello
4a2851231c
Large refactor of `zigbee.mqtt`
...
- Support for device options as children configuration entities
- Refactored switches management, removed legacy `switches` plugin
integration, and supporting multiple binary switches for one device
2023-01-09 01:02:49 +01:00
Fabio Manganiello
27b23b7fae
Normalize array/dict options for values on EnumSwitch
2023-01-09 01:01:35 +01:00
Fabio Manganiello
e9c84ff5d4
Support units on dimmer entities
2023-01-09 01:01:05 +01:00
Fabio Manganiello
32330ca7a8
Merge branch 'master' into 29-generic-entities-support
2023-01-08 23:26:08 +01:00
Fabio Manganiello
a7a107e5fb
Merge pull request #343 from BlackLight/dependabot/npm_and_yarn/platypush/backend/http/webapp/minimatch-3.1.2
...
Bump minimatch from 3.0.4 to 3.1.2 in /platypush/backend/http/webapp
2023-01-08 23:25:17 +01:00
dependabot[bot]
a0e45c38a5
Bump minimatch from 3.0.4 to 3.1.2 in /platypush/backend/http/webapp
...
Bumps [minimatch](https://github.com/isaacs/minimatch ) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases )
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2 )
---
updated-dependencies:
- dependency-name: minimatch
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-08 22:24:41 +00:00
Fabio Manganiello
1ae92dca92
Merge pull request #357 from BlackLight/dependabot/npm_and_yarn/platypush/backend/http/webapp/json5-1.0.2
...
Bump json5 from 1.0.1 to 1.0.2 in /platypush/backend/http/webapp
2023-01-08 23:23:16 +01:00
dependabot[bot]
379c822588
Bump json5 from 1.0.1 to 1.0.2 in /platypush/backend/http/webapp
...
Bumps [json5](https://github.com/json5/json5 ) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases )
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md )
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2 )
---
updated-dependencies:
- dependency-name: json5
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-08 22:22:52 +00:00
Fabio Manganiello
309643dcc6
Merge pull request #345 from BlackLight/dependabot/npm_and_yarn/platypush/backend/http/webapp/loader-utils-1.4.2
...
Bump loader-utils from 1.4.0 to 1.4.2 in /platypush/backend/http/webapp
2023-01-08 23:21:54 +01:00
dependabot[bot]
47c3a24def
Bump loader-utils from 1.4.0 to 1.4.2 in /platypush/backend/http/webapp
...
Bumps [loader-utils](https://github.com/webpack/loader-utils ) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases )
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md )
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2 )
---
updated-dependencies:
- dependency-name: loader-utils
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-08 15:53:12 +00:00
Fabio Manganiello
66000a0774
Merge branch 'master' into 29-generic-entities-support
2023-01-08 00:23:57 +01:00
Fabio Manganiello
2893cb1cc4
Replaced deprecated `missing` marshmallow parameter with `load_default`
2023-01-08 00:15:24 +01:00
Fabio Manganiello
7d90b274ae
Make sure that any existing device monitor is terminated upon disconnection
2023-01-07 23:48:02 +01:00
Fabio Manganiello
72454a6583
Merge branch 'master' into 29-generic-entities-support
2023-01-07 23:31:31 +01:00
Fabio Manganiello
40bdc3b7f3
Always wait 5 seconds (regardless of the poll interval) in case of errors.
...
Also, print the error only on the first occurrence, to prevent log
spamming.
2023-01-07 23:21:59 +01:00
Fabio Manganiello
e8f767d819
Take into account the notify_only_if_changed parameter
2023-01-07 23:11:34 +01:00
Fabio Manganiello
c5cf9803ff
Take into account the notify_only_if_changed parameter
2023-01-07 23:09:42 +01:00
Fabio Manganiello
6630873e2c
Merge branch 'master' into 29-generic-entities-support
2023-01-07 22:39:46 +01:00
Fabio Manganiello
2ee810bdc4
Added missing event to documentation
2023-01-07 22:39:23 +01:00
Fabio Manganiello
b7f266cd92
Merge branch 'master' into 29-generic-entities-support
2023-01-07 22:31:36 +01:00
Fabio Manganiello
a77206800d
Added HID plugin to support interaction with generic HID devices
2023-01-07 22:30:32 +01:00
Fabio Manganiello
c215c693f5
Only pass children that aren't configuration values to the entities
2023-01-03 23:25:43 +01:00
Fabio Manganiello
7868d6fe37
Support for nested configuration objects on entity modals
2023-01-03 23:16:14 +01:00
Fabio Manganiello
13eb515f87
Select current display value by default on EnumSwitch
2023-01-03 23:14:57 +01:00
Fabio Manganiello
01727f53bc
Support for is_configuration flag on `zwave` entities
2023-01-03 23:13:34 +01:00
Fabio Manganiello
c32aecece3
Added is_configuration flag to entities
2023-01-03 23:12:27 +01:00
Fabio Manganiello
81fee3ea2a
Style tweaks
2023-01-03 23:11:39 +01:00
Fabio Manganiello
71ed545cc7
Fancier gradient background for the navigator header
2023-01-02 23:28:53 +01:00
Fabio Manganiello
0f60bc2131
Don't delete external_id and data attributes unless they are set
2023-01-02 21:01:46 +01:00
Fabio Manganiello
b0671354ea
(Tentative) support for zwave light colors
2023-01-02 12:50:01 +01:00
Fabio Manganiello
4f75cbc8b4
Updated frontend dist files
2023-01-01 23:23:18 +01:00
Fabio Manganiello
80c2c77272
Support for entities with children on the frontend
2023-01-01 23:06:40 +01:00
Fabio Manganiello
772ba6adb0
Merge branch 'master' into 29-generic-entities-support
2023-01-01 13:19:31 +01:00
Fabio Manganiello
dd3c4b10c7
Run register_service in a separate thread in `backend.http`.
...
The Zeroconf registration part may randomly get stuck, resulting in the
web server not being properly started.
It's therefore better to run the Zeroconf registration process
asynchronously, for it's not strictly required for the web server to
execute.
2023-01-01 13:19:11 +01:00
Fabio Manganiello
edddc90d73
Run register_service in a separate thread in `backend.http`.
...
The Zeroconf registration part may randomly get stuck, resulting in the
web server not being properly started.
It's therefore better to run the Zeroconf registration process
asynchronously, for it's not strictly required for the web server to
execute.
2023-01-01 13:16:46 +01:00
Fabio Manganiello
1c811a490f
Don't serialize children_ids in Entity.to_json()
...
Serializing both children_ids and parent_id can result in nasty
SQLAlchemy bugs, especially when handling objects that haven't been
flushed yet.
2023-01-01 12:47:15 +01:00
Fabio Manganiello
f9b6799a18
A more robust and scalable way of merging/handling the currentValue/targetValue duality in zwave.mqtt
2023-01-01 12:45:41 +01:00
Fabio Manganiello
0513339be7
Merge branch 'master' into 29-generic-entities-support
2022-12-20 23:06:19 +01:00
Fabio Manganiello
84ce31cab0
Bump version: 0.24.3 → 0.24.4
2022-12-20 23:05:42 +01:00
Fabio Manganiello
d0d333e8f4
FIX: Clear the cronjob event after receiving a TIME_SYNC.
...
When a cronjob receives a TIME_SYNC event (because the system clock has
changed/drifted and the cronjobs are expected to recalculate their next
run slot) it should also clear the event.
Otherwise, the next `wait` will be skipped and the cronjob will be
executed even if it wasn't scheduled.
2022-12-20 23:01:03 +01:00
Fabio Manganiello
2feaba7bf4
Add children_ids attribute to entities when converted to JSON
2022-12-18 21:03:12 +01:00
Fabio Manganiello
3615a269fe
Use Float instead of Numeric on NumericSensor table.
...
The Numeric type may have casting/rounding issues with SQLite.
2022-12-18 15:25:22 +01:00
Fabio Manganiello
5763c5e0ba
Don't use the entities cache when upserting entities.
...
This may make things a bit less optimal, but it's probably the only
possible solution that preserves my sanity.
Managing upserts of cached instances that were previously made transient
and expunged from the session is far from easy, and the management of
recursive parent/children relationships only add one more layer of
complexity (and that management is already complex enough in its current
implementation).
2022-12-18 15:13:21 +01:00
Fabio Manganiello
b0464219d3
Large refactor of the entities engine.
2022-12-17 21:41:23 +01:00
Fabio Manganiello
9ddebb920f
Merge branch 'master' into 29-generic-entities-support
2022-12-17 00:51:51 +01:00
Fabio Manganiello
6666f5581c
Bump version: 0.24.2 → 0.24.3
2022-12-17 00:31:22 +01:00
Fabio Manganiello
3279a6ca53
Merge pull request 'Add author and tags attributes to RSS feed entries' ( #238 ) from 236-add-author-and-tags-columns-to-feeds into master
...
Reviewed-on: platypush/platypush#238
2022-12-17 00:25:09 +01:00
Fabio Manganiello
152ebdf737
[ #236 ] Added `author` and `tags` attributes to new feed entry event and schema objects.
2022-12-17 00:21:32 +01:00
Fabio Manganiello
cd569c76aa
Changed deprecated format of description_file in setup.cfg
2022-12-16 23:20:26 +01:00
Fabio Manganiello
b044fa4acf
s/disable_logging/logging_level/g on entity events.
2022-12-11 11:58:49 +01:00
Fabio Manganiello
3e41418742
Merge branch 'master' into 29-generic-entities-support
2022-12-11 11:47:12 +01:00
Fabio Manganiello
2ee2a1d7b5
Replaced `disable_logging` with a more generic `logging_level`.
...
The `disable_logging` attribute was only available on events and
responses, and it could only either entirely disable or enable logging
for all the events of a certain type.
The new flag allows more customization by setting the default logging
level used for any message of a certain type (or `None` to disable
logging). This makes it possible to e.g. set some verbose events to
debug level, and the user can see them if they configure the application
in debug mode.
It also delegates the logging logic to the message itself, instead of
having different parts of the application handling their own logic.
2022-12-11 11:46:37 +01:00
Fabio Manganiello
d4b540dd67
Replaced `disable_logging` with a more generic `logging_level`.
...
The `disable_logging` attribute was only available on events and
responses, and it could only either entirely disable or enable logging
for all the events of a certain type.
The new flag allows more customization by setting the default logging
level used for any message of a certain type (or `None` to disable
logging). This makes it possible to e.g. set some verbose events to
debug level, and the user can see them if they configure the application
in debug mode.
It also delegates the logging logic to the message itself, instead of
having different parts of the application handling their own logic.
2022-12-11 11:39:38 +01:00
Fabio Manganiello
dff54a5246
Merge branch 'master' into 29-generic-entities-support
2022-12-11 10:59:58 +01:00
Fabio Manganiello
aa3479abeb
Added [-v|--verbose] and --version options to the command line.
2022-12-11 10:59:12 +01:00
Fabio Manganiello
a1d3724b8d
Added [-v|--verbose] and --version options to the command line.
2022-12-11 10:54:03 +01:00
Fabio Manganiello
cf9d34d38e
A more robust logic to parse `zwave.mqtt` value attributes.
2022-12-10 16:21:29 +01:00
Fabio Manganiello
c4f649a0d5
`autoflush` should be passed as an option to `db.get_session`.
2022-12-10 16:20:14 +01:00
Fabio Manganiello
6a2a3100f8
LINT fixes for `zwave.mqtt` backend
2022-12-10 16:16:23 +01:00
Fabio Manganiello
5a47308516
Merge branch 'master' into 29-generic-entities-support
2022-12-10 15:57:28 +01:00
Fabio Manganiello
4c8190ac14
Bump version: 0.24.1 → 0.24.2
2022-12-10 15:37:49 +01:00
Fabio Manganiello
6713bf6994
Fixed `backend.zwave` event logic dispatch for recent versions of ZWaveJS.
...
ZWaveJS has broken back-compatibility with zwavejs2mqtt when it comes to
events format.
Only a partial representation of the node and value objects is
forwarded, and that's often not sufficient to infer the full state of
the node with its values.
The `_dispatch_event` logic has therefore been modified to accommodate
both the implementation.
This means that we have to go conservative in order to preserve
back-compatibility and not over-complicate things, even if it (slightly)
comes at the expense of performance.
2022-12-10 15:35:09 +01:00
Fabio Manganiello
313105f014
Fixed `backend.zwave` event logic dispatch for recent versions of ZWaveJS.
...
ZWaveJS has broken back-compatibility with zwavejs2mqtt when it comes to
events format.
Only a partial representation of the node and value objects is
forwarded, and that's often not sufficient to infer the full state of
the node with its values.
The `_dispatch_event` logic has therefore been modified to accommodate
both the implementation.
This means that we have to go conservative in order to preserve
back-compatibility and not over-complicate things, even if it (slightly)
comes at the expense of performance.
2022-12-10 14:52:10 +01:00
Fabio Manganiello
a17bc3c474
`main.db` should use the configured `workdir` when not specified.' ( #235 )
...
Reviewed-on: platypush/platypush#235
Closes: platypush/platypush#234
2022-12-09 23:41:07 +01:00
Fabio Manganiello
219a0a99ca
`main.db` should use the configured `workdir` when not specified.
...
Closes : #234
Reviewed-On: platypush/platypush#234
2022-12-09 23:37:10 +01:00
Fabio Manganiello
3b1147eaae
Bump version: 0.24.0 → 0.24.1
2022-12-08 12:33:34 +01:00
Fabio Manganiello
5ba3fa1b5b
FIX: Parenthesized context managers are only available in Python >= 3.10
...
Since Parenthesized context managers are only supported on very recent
versions of Python (thanks black for breaking back-compatibility), we
should still use the old multiline syntax - it's not worth breaking
compatibility with Python >= 3.6 and < 3.10 just to avoid typing a
backslash.
2022-12-08 12:28:36 +01:00
Fabio Manganiello
00fca6b187
Merge branch 'master' into 29-generic-entities-support
2022-12-04 20:58:06 +01:00
Fabio Manganiello
00a918dd20
Support for the new way of reporting events on ZWaveJS-UI.
...
The most recent versions of ZwaveJS-UI don't send the `hexId` of the
node on node change events. We have therefore to infer it from the
reported `dbLink`.
2022-12-04 20:56:52 +01:00
Fabio Manganiello
3a92bf59ca
Support for the new way of reporting events on ZWaveJS-UI.
...
The most recent versions of ZwaveJS-UI don't send the `hexId` of the
node on node change events. We have therefore to infer it from the
reported `dbLink`.
2022-12-04 20:48:42 +01:00
Fabio Manganiello
ecba72935f
Check for table metadata existance in `Base.metadata` instead of having a separate entity registry
2022-12-04 16:28:46 +01:00
Fabio Manganiello
1ab85f99d9
Support for illuminance sensor entities on `zigbee.mqtt`
2022-11-30 02:16:56 +01:00
Fabio Manganiello
09d70e2ff1
The `zwavejs2mqtt` project has been renamed `zwave-js-ui`
...
Change the documentation accordingly
2022-11-30 02:04:48 +01:00
Fabio Manganiello
b6370b51da
Extended humidity sensors detection for zigbee.mqtt
2022-11-30 01:24:35 +01:00
Fabio Manganiello
16c24d799d
Removed custom formatting for child zigbee/zwave entity names
...
The parent->child relationship is now modelled on the database itself,
so we no longer need value names specifically formatted as
`[DeviceName] ValueName` - the UI will take care of it.
2022-11-30 01:02:25 +01:00
Fabio Manganiello
080b21ab70
Added support for reachable flag on zwave.mqtt child entities
2022-11-30 01:01:45 +01:00
Fabio Manganiello
2b532c1947
Implemented parent/child support for zigbee.mqtt entities
2022-11-30 00:55:04 +01:00
Fabio Manganiello
abaeabea22
Implemented recursive merges of parent/child relationships in entities
2022-11-30 00:50:53 +01:00
Fabio Manganiello
cc156a53a1
Support for parent/children relationships on `zwave.mqtt` entities
2022-11-28 21:42:11 +01:00
Fabio Manganiello
0edd73690b
Modelling of parent/children relationships on entity level
2022-11-28 21:36:00 +01:00
Fabio Manganiello
0e0c90f0f2
zwave.mqtt additions
...
- Infer entity types on the basis of their semantic type (bool, decimal,
list) and read-only attribute (read-only bool is `BinarySensor`,
read-write bool is `Switch`, read-only decimal is `NumericSensor`,
read-write decimal is `Dimmer`, etc.) instead of trying to infer it
from the command class. Only a small set of command classes (like
configurations, vendor-specific or internal values) will be excluded.
This should greatly increase the number of supported values.
- Added support for `EnumSwitch` entities.
- Added inference for illuminance and humidity sensors.
2022-11-27 22:53:53 +01:00
Fabio Manganiello
78c59f437a
Added support for illuminance sensor entities
2022-11-27 22:38:58 +01:00
Fabio Manganiello
03d1c554ea
Updated webapp dist files
2022-11-27 14:23:30 +01:00
Fabio Manganiello
b1a7a7d915
Fixed little overlap between the entities' header and the navigator
2022-11-27 12:56:39 +01:00
Fabio Manganiello
b5653e070e
Style improvements for the main navigator
2022-11-27 12:56:17 +01:00
Fabio Manganiello
681f307d04
A more self-explanatory icon for entity grouping selections
2022-11-27 00:56:47 +01:00
Fabio Manganiello
bba582875a
The `data` attribute on `EntityUpdateEvent` shouldn't be taken into account for flashing updates
2022-11-27 00:56:23 +01:00
Fabio Manganiello
e8d6717fcb
Added input box for <Dimmer> entities
2022-11-27 00:56:01 +01:00
Fabio Manganiello
bd59a5eefd
Support for range labels on <Slider>
2022-11-27 00:55:19 +01:00
Fabio Manganiello
f8aaab20f5
Updated webapp dist files
2022-11-27 00:53:58 +01:00
Fabio Manganiello
faa8295469
White background for main nav
2022-11-26 01:52:42 +01:00
Fabio Manganiello
d29723ea41
Keep the main menu items vertically aligned to the center also on tablets
2022-11-26 01:28:20 +01:00
Fabio Manganiello
d0c8a8edf9
A bit of padding for LightHue on mobile
2022-11-26 01:19:52 +01:00
Fabio Manganiello
37254cad1a
Mobile UI improvements
2022-11-26 01:16:07 +01:00
Fabio Manganiello
f28f08dd1a
Keep the main menu open on page load by default on >= desktop
2022-11-26 01:15:03 +01:00
Fabio Manganiello
fecd96f64c
Solved issue with main menu shrinking a bit when the main panel has too much wide content
2022-11-26 00:32:11 +01:00
Fabio Manganiello
33cc055249
Switched expanded main menu to light colors
2022-11-26 00:31:36 +01:00
Fabio Manganiello
a57e67b96f
Better style for the settings' users and token panels
2022-11-25 23:16:16 +01:00
Fabio Manganiello
21c1c96f2e
Use Dropdown for the settings menu
2022-11-25 23:15:41 +01:00
Fabio Manganiello
292ed2abff
Better style for dropdown items.
...
- Larger icon div to prevent text overlapping with icons
- Support for `selected` class
2022-11-25 23:14:28 +01:00
Fabio Manganiello
73f6712f7a
Bump version: 0.23.6 → 0.24.0
2022-11-22 00:12:25 +01:00
Fabio Manganiello
c0dd91838b
Merge branch 'master' into 29-generic-entities-support
2022-11-21 22:13:47 +01:00
Fabio Manganiello
d95baac74e
Add user credentials on the encrypted JWT token.
...
Adding the credentials ensures that tokens associated to non-existing
users, or users with an invalid password, won't be accepted, even if
they were correctly encrypted using the host's keypair.
This adds an additional layer of security in case the host's keypair
gets compromised.
2022-11-21 13:16:09 +01:00
Fabio Manganiello
98d7c95aa7
Removed two unrequired `return` statements
2022-11-21 13:04:48 +01:00
Fabio Manganiello
ba1681fc22
Merge branch 'master' into 29-generic-entities-support
2022-11-21 12:36:01 +01:00
Fabio Manganiello
a2c8e27bd8
Removed PyJWT dependency.
...
PyJWT is a very brittle and cumbersome dependency that expects several
cryptography libraries to be already installed on the system, and it can
lead to hard-to-debug errors when ported to different systems.
Moreover, it installs the whole `cryptography` package, which is several
MBs in size, takes time to compile, and it requires a Rust compiler to
be present on the target machine.
Platypush will now use the Python-native `rsa` module to handle JWT
tokens.
2022-11-21 12:30:38 +01:00
Fabio Manganiello
02f89258b8
FIX: Task.set_name only works on Python >= 3.8
2022-11-21 09:49:57 +01:00
Fabio Manganiello
ae17a12c12
FIX: `UserManager.get_users`
...
`UserManager.get_users` should not return a reference to the query
object, since the query object will be invalidated as soon as the
connection is closed.
Instead, it should return directly the list of `User` objects.
2022-11-21 00:57:00 +01:00
Fabio Manganiello
e579fb3417
Don't display sensors with null value
2022-11-21 00:05:19 +01:00
Fabio Manganiello
b9e6614b04
Added support for `EnumSensor` entities
2022-11-21 00:04:07 +01:00
Fabio Manganiello
d171000a0e
Initial support for sensor entities in `zwave.mqtt`
2022-11-14 22:08:15 +01:00
Fabio Manganiello
a7bc4f443c
Imports order
2022-11-14 21:30:43 +01:00
Fabio Manganiello
45d0e4445b
Sorted entity type names
2022-11-14 00:46:58 +01:00
Fabio Manganiello
96ce4729f9
Updated webapp dist files
2022-11-14 00:46:40 +01:00
Fabio Manganiello
b7757d17cc
Updated webapp dist files
2022-11-14 00:06:41 +01:00
Fabio Manganiello
7fac5392b8
Blink entities only if their values have actually changed
2022-11-13 23:52:21 +01:00
Fabio Manganiello
211372e472
Added support for dimmers on `zigbee.mqtt`
2022-11-13 18:48:36 +01:00
Fabio Manganiello
833d908a32
Blink entities body upon update
2022-11-13 01:39:40 +01:00
Fabio Manganiello
24f5a8283c
Added `PRAGMA foreign_keys = ON` before deleting entities on SQLite
...
SQLite doesn't enable foreign keys cascade on delete by default.
2022-11-13 01:18:45 +01:00
Fabio Manganiello
f90d84a3d4
Don't wait for UI updates for entities that are not queriable
2022-11-13 00:54:37 +01:00
Fabio Manganiello
fb594cb8b1
Updated webapp dist files
2022-11-12 16:31:35 +01:00
Fabio Manganiello
69e097707d
Don't lock read session from the main database
2022-11-12 16:10:57 +01:00
Fabio Manganiello
86edd70d93
Fixed session/concurrency management on the main SQLite db
...
- The `declarative_base` instance should be shared
- Database `session_locks` should be stored at module, not instance
level
- Better isolation of scoped sessions
- Enclapsulated `get_session` method in `UserManager`
2022-11-12 15:36:17 +01:00
Fabio Manganiello
bfeb0a08c4
Encapsulate `_get_session` in `EntityManager`
2022-11-12 15:14:10 +01:00
Fabio Manganiello
8450129858
LINT fixes
2022-11-12 11:39:12 +01:00
Fabio Manganiello
8a894d0989
`user_manager` should be a global object instead of being initialized on-demand
2022-11-12 11:38:40 +01:00
Fabio Manganiello
6b7933cd33
Using a different SQLite database for entities
...
This prevents multiprocessing/concurrency issues when modifying the same
database file both from the main process and from the web server process
2022-11-12 02:00:55 +01:00
Fabio Manganiello
3fc94181b7
LINT fixes
2022-11-11 22:02:36 +01:00
Fabio Manganiello
26f869b6e4
LINT fixes
2022-11-11 21:49:38 +01:00
Fabio Manganiello
02a4c9f667
Added is_query_disabled attribute to entities
2022-11-11 20:40:36 +01:00
Fabio Manganiello
84bb77bd5b
Replaced ambiguous logger variable name
2022-11-11 20:37:39 +01:00
Fabio Manganiello
00a43dd1f8
Implemented `EnumSwitch` entity type
...
Done for `zigbee.mqtt`, other plugins will follow
2022-11-11 01:46:38 +01:00
Fabio Manganiello
801ed05684
Added support for binary sensors (in zigbee.mqtt for now)
2022-11-05 01:47:50 +01:00
Fabio Manganiello
6454f9d018
Propert snake case -> camel case conversion for backend entities -> frontend components
2022-11-04 22:53:24 +01:00
Fabio Manganiello
0f19104512
Improved zigbee.mqtt node property queries.
...
Now handling cases of nodes with values having multiple levels (> 1) of
nested properties.
2022-11-04 22:51:40 +01:00
Fabio Manganiello
5ca3c06f96
Normalize device names in set_lights
2022-11-02 23:32:21 +01:00
Fabio Manganiello
d5f8d55b4b
Fixed zigbee.mqtt light entity conversion
2022-11-02 23:07:12 +01:00
Fabio Manganiello
636d1ced3a
A more robust way of splitting devices provided in the <ieee_address:value> format
2022-11-02 22:49:19 +01:00
Fabio Manganiello
7db84acd34
Notify of entity scan timeouts on the console instead of creating tons of notifications
2022-11-02 22:24:06 +01:00
Fabio Manganiello
02abef71e3
Fixes for zigbee devices polling
...
- Don't publish a `get` request if the device has no exposed queriable
attributes.
- Perform the recursive build of the `get` request payload before
checking for the `access` attribute.
2022-11-02 21:54:47 +01:00
Fabio Manganiello
64513be6b8
Initial implementation of sensor entities.
...
Implemented (at least in `zigbee.mqtt`, for now):
- `TemperatureSensor`
- `HumiditySensor`
- `VoltageSensor`
- `CurrentSensor`
- `EnergySensor`
- `PowerSensor`
- `NumericSensor` (generic fallback 1)
- `RawSensor` (generic fallback 2)
- `Sensor` (root class)
2022-11-02 16:38:17 +01:00
Fabio Manganiello
440cd60d6e
A (slightly) smarter way to infer the plural spelling of singular entity names
2022-11-02 16:35:20 +01:00
Fabio Manganiello
3d1a08f7af
Changed default entity grouping on the frontend.
...
Changed from `type` to `category`, which is basically the `name_plural`
attribute of the associated entity type metadata.
This allows us to define distinct entity metadata entries that we still
want to share the same grouping - for instance, `temperature_sensor`,
`humidity_sensor` and `battery` should all be grouped under `Sensors` on
the frontend.
2022-11-02 16:33:12 +01:00
Fabio Manganiello
68dd09e8ae
Removed unused `expanded` data attribute
2022-11-02 16:31:50 +01:00
Fabio Manganiello
d7214c4c83
Fix for `No converter available` warnings on zigbee2mqtt
...
Only include readable (not state-only) properties on the payload sent to
to `zigbee2mqtt/<device>/get`.
2022-10-31 00:51:26 +01:00
Fabio Manganiello
a1cf671334
Added support for link_quality entities to `zigbee.mqtt`
2022-10-30 11:03:22 +01:00
Fabio Manganiello
78dc8416fb
Snake case -> camel case for backend -> frontend entity types conversion
2022-10-30 11:01:46 +01:00
Fabio Manganiello
691d109fb7
Expunge entities after session commit to ensure that the ORM objects can be reused
2022-10-30 11:00:09 +01:00
Fabio Manganiello
71ccf6d04a
Support for battery sensors on zigbee.mqtt
2022-10-29 18:16:38 +02:00
Fabio Manganiello
42651e937b
LINT fixes on zigbee.mqtt plugin
2022-10-29 14:09:44 +02:00
Fabio Manganiello
d61b053f72
Support for battery entities
2022-10-29 13:38:42 +02:00
Fabio Manganiello
cdacf50fc7
Support for decimal.Decimal type JSON serialization
2022-10-29 13:35:52 +02:00
Fabio Manganiello
b8215d2736
A more robust cron start logic
...
If may happen (usually because of a race condition) that a cronjob has
already been started, but it hasn't yet changed its status from IDLE to
RUNNING when the scheduler checks it.
This fix guards the application against such events. If they occur, we
should just report them and move on, not terminate the whole scheduler.
2022-10-27 10:45:59 +02:00
Fabio Manganiello
486cd66885
More LINTs
2022-10-23 21:23:19 +02:00
Fabio Manganiello
72c7444a45
LINT
2022-10-23 18:23:20 +02:00
Fabio Manganiello
951950c864
Added dimmer entities
2022-10-23 00:30:32 +02:00
Fabio Manganiello
d7278857e5
Ensure that no records with duplicate key exist within an SQLAlchemy session before flushing
2022-10-23 00:28:42 +02:00
Fabio Manganiello
3e6ebdd23b
Don't store/show the state of write-only toggle switches
2022-10-23 00:28:01 +02:00
Fabio Manganiello
8cd5cb3338
The Slider should only react to @input events
2022-10-23 00:26:59 +02:00
Fabio Manganiello
1af7ece881
Added deprecation notice for `zwave` plugin and backend (use `zwave.mqtt` instead)
2022-10-22 19:17:58 +02:00
Fabio Manganiello
5c68365188
Better management for entity error icons
2022-10-14 23:37:36 +02:00
Fabio Manganiello
7f575bacaa
Implemented the new zwavejs2mqtt features for adding and removing nodes
2022-10-14 23:28:02 +02:00
Fabio Manganiello
5995d045e1
Merge branch 'master' into 29-generic-entities-support
2022-10-14 20:57:13 +02:00
Fabio Manganiello
a5db599268
FIX: Skip empty lines on `config.include`
2022-10-14 20:56:18 +02:00
Fabio Manganiello
c89ed24f4b
Updated webapp dist files
2022-10-12 03:07:17 +02:00
Fabio Manganiello
1b791156bd
Proper support for color zigbee lights
2022-10-12 03:00:42 +02:00
Fabio Manganiello
e617fc75d4
Fixed slider ranges and label
2022-10-12 02:59:50 +02:00
Fabio Manganiello
041f64c80f
Dirty workaround to prevent redefinition of SQLAlchemy ORM model classes
2022-10-10 01:38:15 +02:00
Fabio Manganiello
aa5b52db2f
FIX: Still redirect to /register by default if no users have been created
2022-10-10 01:36:28 +02:00
Fabio Manganiello
5f09d449f4
`extend_existing=True` for entity tables
2022-10-09 23:15:50 +02:00
Fabio Manganiello
6ec8a991df
Fixed tests
2022-10-08 15:18:26 +02:00
Fabio Manganiello
958ef6b987
Better entity modal padding
2022-10-07 11:12:30 +02:00
Fabio Manganiello
16c55b45f6
updated dist files
2022-10-07 11:12:13 +02:00
Fabio Manganiello
b9b7404230
Web panel improvements.
...
- Don't return a redirect to the login page if an authentication failed
over a JSON endpoint - instead, return a JSON payload with the error.
- Added support for additional fonts.
- Re-designed the login/registration page.
- Updated caniuse database.
2022-10-07 02:24:29 +02:00
Fabio Manganiello
c0ffea681f
updated dist files
2022-10-07 02:23:12 +02:00
Fabio Manganiello
2aab1d090d
Increased maxkb limit
2022-10-07 02:23:04 +02:00
Fabio Manganiello
2cc80e7f16
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-10-07 00:05:54 +02:00
Fabio Manganiello
b88983f055
Added `qos` argument to `mqtt.publish`.
2022-10-05 01:13:47 +02:00
Fabio Manganiello
85f583a0ad
Reduced :maxdepth: of toctree in documentation.
...
Recent versions of Sphinx get a bit too zealous about generating deeply
nested toctrees.
2022-09-30 11:47:19 +02:00
Fabio Manganiello
fed7c2c6ff
Fixed typo in schema path
2022-09-30 11:30:57 +02:00
Fabio Manganiello
1d78c3e753
FIX: Broken docstring
2022-09-30 10:56:08 +02:00
Fabio Manganiello
00d47731c5
Merge pull request 'Mimic3 integration' ( #227 ) from 226-mimic3-integration into master
...
Reviewed-on: platypush/platypush#227
2022-09-30 10:52:53 +02:00
Fabio Manganiello
ae226a5b01
Added `tts.mimic3` integration.
...
Closes : #226
2022-09-30 10:51:17 +02:00
Fabio Manganiello
fef7aff245
LINT fixes for mpv plugin
2022-09-30 10:41:56 +02:00
Fabio Manganiello
82ab7face2
A more robust logic to detect the webserver local bind address
2022-09-30 03:10:37 +02:00
Fabio Manganiello
3ed10092ae
Merge pull request 'Wallabag integration' ( #225 ) from 222-wallabag-integration into master
...
Reviewed-on: platypush/platypush#225
2022-09-29 10:52:16 +02:00
Fabio Manganiello
4bab9d2607
[ #224 ] Implemented Wallabag integration
2022-09-29 10:51:16 +02:00
Fabio Manganiello
deb25196d2
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-09-28 02:17:10 +02:00
Fabio Manganiello
a0575ed6de
Bump version: 0.23.5 → 0.23.6
2022-09-19 20:41:02 +02:00
Fabio Manganiello
3d74f0a11f
Updated CHANGELOG
2022-09-19 20:40:54 +02:00
Fabio Manganiello
09baceab4b
Include album_id and the list of tracks in music.tidal.get_album
2022-09-19 20:39:21 +02:00
Fabio Manganiello
c2a3f2f4f3
Bump version: 0.23.4 → 0.23.5
2022-09-18 19:55:05 +02:00
Fabio Manganiello
36dd645209
Use session.playlist instead of session.user.playlist to query playlists
2022-09-18 06:04:53 +02:00
Fabio Manganiello
61cda60751
Proper implementation for Tidal's add_to_playlist and remove_from_playlist methods
...
- Using tidalapi's `UserPlaylist.add` and `UserPlaylist.delete` methods
instead of defining my own through `_api_request`, so we won't have to
deal with the logic to set the ETag header.
- Added `remove_from_playlist` method.
2022-09-18 05:22:12 +02:00
Fabio Manganiello
7c610adc84
FIX: Apply expanduser to the credentials_file setting in music.tidal
2022-09-17 06:30:20 +02:00
Fabio Manganiello
a9ebb4805a
Fixed doc warnings
2022-09-17 06:25:28 +02:00
Fabio Manganiello
1b405de0d5
Added missing docs
2022-09-17 06:09:39 +02:00
Fabio Manganiello
e1aa214bad
tidal-integration ( #223 )
...
Reviewed-on: platypush/platypush#223
2022-09-16 21:48:09 +02:00
Fabio Manganiello
41acf4b253
Generate event ID as true random strings, not MD5 hashes of UUIDs
2022-09-05 03:08:39 +02:00
Fabio Manganiello
c77746e278
If the output of a hook is null, make sure to normalize it an empty string before pushing it to Redis
2022-09-04 16:16:02 +02:00
Fabio Manganiello
4682fb4210
Throw an assertion error when on_duplicate_update is specified on db.insert with no key_columns
2022-09-04 16:02:37 +02:00
Fabio Manganiello
0143dac216
Improved support for bulk database statements
...
- Wrapped insert/update/delete operations in transactions
- Proper (and much more efficient) bulk logic
- Better upsert logic
- Return inserted/updated records if the engine supports it
2022-09-04 13:30:35 +02:00
Fabio Manganiello
a90aa2cb2e
Make sure that a webhook function never returns a null response
2022-09-04 00:52:41 +02:00
Fabio Manganiello
1ea53a6f50
Support for query placeholders in `db.select`
2022-09-04 00:28:08 +02:00
Fabio Manganiello
e77d6a4ad4
Merge pull request 'Add support for OPML import and export in the RSS plugin' ( #220 ) from 219-opml-import-export into master
...
Reviewed-on: platypush/platypush#220
2022-09-02 00:24:37 +02:00
Fabio Manganiello
61c96612bc
Merge branch 'master' into 219-opml-import-export
2022-09-02 00:23:57 +02:00
Fabio Manganiello
6c6e68b512
Added support for OPML import and export in the RSS plugin.
...
[closes #219 ]
2022-09-02 00:21:40 +02:00
Fabio Manganiello
a286cf5000
Updated PopcornTime base URL
2022-09-01 11:13:16 +02:00
Fabio Manganiello
c5b12403d0
Implemented support for returning richer HTTP responses on webhooks.
...
A `WebhookEvent` hook can now return a tuple in the format `(data,
http_code, headers)` in order to customize the HTTP status code and the
headers of a response.
2022-09-01 01:37:18 +02:00
Fabio Manganiello
96b2ad148c
A smarter way of building and matching the event condition
2022-08-31 02:19:21 +02:00
Fabio Manganiello
67413c02cd
Handle the case where the condition is a serialized dictionary
2022-08-31 01:55:21 +02:00
Fabio Manganiello
db45d7ecbf
FIX: More robust logic against section configurations that may not be maps
2022-08-31 01:27:53 +02:00
Fabio Manganiello
a675fe6a92
Updated CHANGELOG
2022-08-31 00:49:08 +02:00
Fabio Manganiello
c3fa3315f5
Implemented synchronization with webhook responses.
...
When a client triggers a `WebhookEvent` by calling a configured webhook
over `/hook/<hook_name>`, the server will now wait for the configured
`@hook` function to complete and it will return the returned response
back to the client.
This makes webhooks much more powerful, as they can be used to proxy
HTTP calls or other services, and in general return something to the
client instead of just executing actions.
2022-08-30 23:35:19 +02:00
Fabio Manganiello
1880a99052
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-08-29 01:41:47 +02:00
Fabio Manganiello
e08947a3b7
Merge pull request #311 from BlackLight/dependabot/npm_and_yarn/platypush/backend/http/webapp/terser-5.14.2
...
Bump terser from 5.12.1 to 5.14.2 in /platypush/backend/http/webapp
2022-08-29 00:59:55 +02:00
Fabio Manganiello
6d63d2fc74
Merge pull request #305 from BlackLight/dependabot/npm_and_yarn/platypush/backend/http/webapp/shell-quote-1.7.3
...
Bump shell-quote from 1.7.2 to 1.7.3 in /platypush/backend/http/webapp
2022-08-29 00:59:19 +02:00
Fabio Manganiello
540a7d469e
- Fixed documentation errors and warnings
...
- Split Matrix integration into `plugin` and `client` files.
2022-08-29 00:55:46 +02:00
Fabio Manganiello
b11a0e8bbb
Bump version: 0.23.3 → 0.23.4
2022-08-28 15:27:54 +02:00
Fabio Manganiello
f4360dc0e0
Merge pull request 'Matrix Integration' ( #217 ) from matrix-integration into master
...
Reviewed-on: platypush/platypush#217
Closes : #2
2022-08-28 15:21:05 +02:00
Fabio Manganiello
ba68341d28
Merge branch 'master' into matrix-integration
2022-08-28 15:19:58 +02:00
Fabio Manganiello
4308024eef
Added missing docs
2022-08-28 15:18:23 +02:00
Fabio Manganiello
c417d2f692
Implemented last Matrix integration features.
...
- Added presence, typing and seen receipt events.
- Added set display_name and avatar methods.
2022-08-28 15:17:11 +02:00
Fabio Manganiello
e479ca7e3e
Completing the Matrix plugin integration
...
Newly implemented actions:
- `get_messages`
- `get_room_members`
- `update_device`
- `delete_devices`
- `room_alias_to_id`
- `add_room_alias`
- `delete_room_alias`
- `kick`
- `ban`
- `unban`
- `forget`
2022-08-28 12:26:27 +02:00
Fabio Manganiello
0e3cabc5f6
Support `attribute` parameter on `Function` schema fields.
2022-08-28 11:55:30 +02:00
Fabio Manganiello
d890b6cbe8
Added create_room action
2022-08-27 23:26:42 +02:00
Fabio Manganiello
912168626c
Added join_room, leave_room and invite_to_room and extended handling on invitation events
2022-08-27 21:50:48 +02:00
Fabio Manganiello
513195b396
Implemented support for file upload
2022-08-27 15:12:50 +02:00
Fabio Manganiello
48ec6ef68b
Implemented proper support for encrypted media and added download method
2022-08-26 23:48:29 +02:00
Fabio Manganiello
e4eb4cd7dc
More granular control over trusted devices, and added global synchronization event
2022-08-25 00:34:01 +02:00
Fabio Manganiello
550f026e13
Cleaner logging for assertion errors in plugin actions
2022-08-25 00:30:53 +02:00
Fabio Manganiello
c89c712928
Fixed device trust process
2022-08-24 01:49:43 +02:00
Fabio Manganiello
05908e1a77
Fixing key verification process
2022-08-17 10:28:31 +02:00
Fabio Manganiello
c04bc8d2bc
The matrix plugin joins the AsyncRunnablePlugin family too
2022-08-15 02:18:29 +02:00
Fabio Manganiello
2797ffbe53
The websocket plugin now extends AsyncRunnablePlugin too
2022-08-15 02:18:29 +02:00
Fabio Manganiello
770a14daae
ntfy plugin migrated to AsyncRunnablePlugin.
...
This commit removes a lot of the loop management boilerplate.
2022-08-15 02:18:29 +02:00
Fabio Manganiello
dba03d3e33
Added AsyncRunnablePlugin class.
...
This class handles runnable plugins that have their own asyncio event
loop, without the pain usually caused by the management of multiple
threads + asyncio loops.
2022-08-15 02:18:28 +02:00
Fabio Manganiello
f4672ce5c3
Refactored concurrency model in ntfy plugin
2022-08-15 02:18:28 +02:00
Fabio Manganiello
9e2b4a0043
Removed references to deprecated websockets attributes
2022-08-15 02:18:28 +02:00
Fabio Manganiello
4e3c6a5c16
The websocket plugin now extends AsyncRunnablePlugin too
2022-08-15 02:17:05 +02:00
Fabio Manganiello
e17e65a703
ntfy plugin migrated to AsyncRunnablePlugin.
...
This commit removes a lot of the loop management boilerplate.
2022-08-15 02:17:05 +02:00
Fabio Manganiello
3b1ab78268
Added AsyncRunnablePlugin class.
...
This class handles runnable plugins that have their own asyncio event
loop, without the pain usually caused by the management of multiple
threads + asyncio loops.
2022-08-15 02:17:05 +02:00
Fabio Manganiello
4043878afd
Refactored concurrency model in ntfy plugin
2022-08-15 02:16:25 +02:00
Fabio Manganiello
2e7f3d8868
Removed references to deprecated websockets attributes
2022-08-12 15:22:04 +02:00
Fabio Manganiello
dc7ba881f1
Merge branch 'master' into matrix-integration
2022-08-12 14:39:13 +02:00
Fabio Manganiello
4e1e6da67e
Added recv action on websocket plugin
2022-08-12 14:16:01 +02:00
Fabio Manganiello
354f3906f9
Changed autojoin_on_invite default value
2022-08-12 00:11:15 +02:00
Fabio Manganiello
7ab02e705d
Removed redundant _action_wrapper decorator
2022-08-05 19:04:43 +02:00
Fabio Manganiello
cbe2e7bbfe
[WIP]
2022-08-04 03:08:54 +02:00
Fabio Manganiello
c17d0080b5
Merge branch 'master' into matrix-integration
2022-08-04 02:14:22 +02:00
Fabio Manganiello
55671f4aff
If a request on a RunnablePlugin throws an exception then we should also restart the plugin upon reload
...
Plus some Black/LINT chores
2022-07-25 00:41:08 +02:00
Fabio Manganiello
c32142c8b5
Added wait_stop() method to RunnablePlugin
2022-07-23 17:33:23 +02:00
Fabio Manganiello
32be4df11c
More robust way to retrieve an object's attribute on schemas
2022-07-23 17:32:14 +02:00
dependabot[bot]
c7927a3d2f
Bump terser from 5.12.1 to 5.14.2 in /platypush/backend/http/webapp
...
Bumps [terser](https://github.com/terser/terser ) from 5.12.1 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases )
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md )
- [Commits](https://github.com/terser/terser/commits )
---
updated-dependencies:
- dependency-name: terser
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 00:35:29 +00:00
Fabio Manganiello
3edb8352b4
Support sections with empty bodies in the YAML configuration files.
2022-07-16 02:09:22 +02:00
Fabio Manganiello
cc29136db7
[ #2 ] Support for caching rooms info and exposing them in the events
2022-07-15 00:37:21 +02:00
Fabio Manganiello
719bd4fddf
[ #217 WIP] Initial plugin implementation.
...
- Added initial synchronization and users cache.
- Added loop to poll for new events (TODO: use websocket after the first sync)
- Added login, sync and join actions
2022-07-14 01:50:46 +02:00
Fabio Manganiello
3513ee3e1c
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-07-08 23:13:36 +02:00
dependabot[bot]
06168d4ebd
Bump shell-quote from 1.7.2 to 1.7.3 in /platypush/backend/http/webapp
...
Bumps [shell-quote](https://github.com/substack/node-shell-quote ) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases )
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md )
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3 )
---
updated-dependencies:
- dependency-name: shell-quote
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-06-23 11:29:13 +00:00
Fabio Manganiello
0d0995d71d
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-06-02 20:58:34 +02:00
Fabio Manganiello
2898a33752
s/click_url/url/g in ntfy message definitions
2022-06-02 00:36:14 +02:00
Fabio Manganiello
0919a0055d
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-06-02 00:13:43 +02:00
Fabio Manganiello
5b3e1317f4
Only refresh entities that are visible on the interface
2022-05-30 09:23:25 +02:00
Fabio Manganiello
1df71cb54a
Proper support for light entities on smartthings
2022-05-30 09:23:05 +02:00
Fabio Manganiello
0689e05e96
Apply the light color to the icon fill instead of the bulb icon itself
2022-05-30 09:18:19 +02:00
Fabio Manganiello
89560e7c38
Only include entities associated to enabled plugins or with no plugins in `entities.get`
2022-05-29 23:59:46 +02:00
Fabio Manganiello
30dfdeecb0
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-05-25 10:11:57 +02:00
Fabio Manganiello
f57f940d57
Made _is_switch more resilient against rogue Z-Wave values
2022-05-01 22:18:46 +02:00
Fabio Manganiello
117f92e5b4
Deprecated the `light.hue` backend
...
The polling logic has been moved to the `light.hue` plugin itself
instead, so it's no longer required to have both a plugin and a backend
enabled in order to fully manage a Hue bridge.
2022-05-01 21:55:35 +02:00
Fabio Manganiello
a5541c33b0
Added support for light entities in zigbee.mqtt
...
TODO: Support for colors (I don't have a color Zigbee bulb to test it on yet)
2022-05-01 21:10:54 +02:00
Fabio Manganiello
b23f45f45e
Process a zigbee entity update event with all the properties, not only the ones that have been changed
2022-05-01 21:09:13 +02:00
Fabio Manganiello
088cf23958
Do not emit input event from the light component upon update
...
It may be an incomplete update that breaks the UI, and it will be
overwritten by the backend event anyway
2022-05-01 21:08:02 +02:00
Fabio Manganiello
e8f4b7c10e
CSS adjustments
2022-05-01 15:44:57 +02:00
Fabio Manganiello
dd12d57552
Added light UI entity component
2022-05-01 15:35:20 +02:00
Fabio Manganiello
5aa3750807
Re-sync the list of entities when the entities component is mounted
2022-05-01 15:34:45 +02:00
Fabio Manganiello
f760d44224
Refactored/simplified UI code for entities management
2022-05-01 15:34:15 +02:00
Fabio Manganiello
8d91fec771
Better implementation for light.hue.set_lights
2022-05-01 15:33:12 +02:00
Fabio Manganiello
c22c17a55d
More flexible implementation for LightPlugin abstract methods
2022-05-01 15:31:45 +02:00
Fabio Manganiello
46df3a6a98
FIX: `reachable` is an attribute of `state`
2022-05-01 01:58:05 +02:00
Fabio Manganiello
8e06b8c727
Fixed range scaling on Slider component
2022-04-30 23:40:14 +02:00
Fabio Manganiello
30a024befb
Manage hue/sat/bri/ct light ranges on the light entity object itself
2022-04-30 19:38:50 +02:00
Fabio Manganiello
b16af0a97f
Include entity `data` attributes in the entity info modal
2022-04-30 16:39:37 +02:00
Fabio Manganiello
c7970842d7
Disable logging by default for entity events (they can be quite spammy)
2022-04-30 02:13:20 +02:00
Fabio Manganiello
7df67aca82
updated_at should have utcnow() onupdate, not now()
2022-04-30 01:48:55 +02:00
Fabio Manganiello
d29b377cf1
Exclude deleted lights/groups/scenes from the returned lists
2022-04-30 01:39:39 +02:00
Fabio Manganiello
8d57cf06c2
Major refactor for the `light.hue` plugin.
...
- Added support for lights as native platform entities.
- Improved performance by using the JSON API objects whenever possible
to interact with the bridge instead of the native Python objects,
which perform a bunch of lazy API calls under the hood resulting in
degraded performance.
- Fixed lights animation attributes by setting only the ones actually
supported by a light.
- Several LINT fixes.
2022-04-30 01:07:00 +02:00
Fabio Manganiello
975d37c562
Added relevant attributes to `light` entities
2022-04-29 23:29:04 +02:00
Fabio Manganiello
90f067de61
Added `reachable` flag to device entities
2022-04-29 23:27:35 +02:00
Fabio Manganiello
f45df5d4d3
Explictly cast entity IDs to strings when coalescing entity updates
...
Some plugins may represent entity IDs as integers, while the database
maps external IDs to strings. This may result in entities being
incorrectly mapped during merging. Casting to string prevents these
type-related ambiguities.
2022-04-29 23:24:28 +02:00
Fabio Manganiello
975991ba69
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-04-29 16:53:41 +02:00
Fabio Manganiello
d22fbcd9db
Merge branch 'master' into 191-support-for-general-entities-backend-and-plugin
2022-04-28 01:58:24 +02:00
Fabio Manganiello
47f8520f3b
Added support for description/read_only/write_only on entity level
2022-04-24 22:18:29 +02:00
Fabio Manganiello
d261b9bb9b
Frontend support for entities deletion
2022-04-24 21:40:10 +02:00
Fabio Manganiello
9981cc4746
Backend support for entities deletion
2022-04-24 21:38:45 +02:00
Fabio Manganiello
3e4b13d20f
Added standard Vue component for confirm dialogs
2022-04-24 21:34:39 +02:00
Fabio Manganiello
321a61d06d
Align .section.right content to the right
2022-04-24 11:30:52 +02:00
Fabio Manganiello
b22df768eb
Fixed entity icon alignment on mobile
2022-04-24 01:42:14 +02:00
Fabio Manganiello
8e2154f2b5
Do not overwrite an entity's state from an event if the state was not sampled
2022-04-24 01:41:45 +02:00
Fabio Manganiello
a9751f21f1
`entities` should be the default view when the web panel is opened
2022-04-24 01:40:34 +02:00
Fabio Manganiello
135965176d
Support for entity icon color change
2022-04-23 17:52:21 +02:00
Fabio Manganiello
ef6b57df31
Added entity info modal and (partial) support for renaming entities
2022-04-23 01:01:14 +02:00
Fabio Manganiello
7d4bd20df0
Support for individual entity group refresh
2022-04-19 23:56:49 +02:00
Fabio Manganiello
e6bfa1c50f
Better dynamic entities discovery
2022-04-13 11:25:14 +02:00
Fabio Manganiello
332c91252c
zwave.mqtt.status renamed to controller_status, while status should return the current state of the values
2022-04-12 23:44:14 +02:00
Fabio Manganiello
b35c761a43
Fixed entities panel mobile layout
2022-04-12 22:24:19 +02:00
Fabio Manganiello
08c0779347
<style> on entity components should be scoped
2022-04-12 16:00:31 +02:00
Fabio Manganiello
595ebe49ca
Support for entity scan timeout errors and visual error handling
2022-04-12 15:58:19 +02:00
Fabio Manganiello
548d487e73
Publish a switch entity from zigbee.mqtt only if the update includes its state
2022-04-12 14:41:21 +02:00
Fabio Manganiello
20530c2b6d
Loading events are now synchronized both ways upon entity action/refresh
2022-04-12 01:10:09 +02:00
Fabio Manganiello
9ddcf5eaeb
Implemented entities refresh on the UI
2022-04-12 00:43:22 +02:00
Fabio Manganiello
2aa8778078
Do not process EntityUpdateEvents only in case of payload changes
...
The UI relies on these events upon refresh to detect if a device is
still reacheable. Therefore, we shouldn't mask them if we don't detect
any changes with the current entity configuration/state.
2022-04-12 00:41:20 +02:00
Fabio Manganiello
72617b4b75
Handle EntityUpdateEvents on the UI
2022-04-11 23:16:29 +02:00
Fabio Manganiello
be4d1e8e01
Proper support for native entities in zigbee.mqtt integration
2022-04-11 21:16:45 +02:00
Fabio Manganiello
db4ad5825e
Fire an EntityUpdateEvent when the zwave.mqtt backend gets a value changed message
2022-04-11 01:40:49 +02:00
Fabio Manganiello
4471001110
smartthings.toggle should properly publish the updated entity
2022-04-11 00:43:31 +02:00
Fabio Manganiello
f17245e8c7
Send an EntityUpdateEvent only if an entity has already been persisted
...
If an event comes from an entity that hasn't been persisted yet on the
internal storage then we wait for the entity record to be committed
before firing an event. It's better to wait a couple of seconds for the
database to synchronize rather than dealing with entity events with
incomplete objects.
2022-04-11 00:38:11 +02:00
Fabio Manganiello
67ff585f6c
Entities engine improvements
...
- Added cache support to prevent duplicate EntityUpdateEvents
- The cache is smartly pre-populated and kept up-to-date, so it's
possible to trigger events as soon as the entities are published by
the plugin (not only when the records are flushed to the internal db)
2022-04-11 00:01:21 +02:00
Fabio Manganiello
17615ff028
Support for multiple entity types/plugins filter on entities.get
2022-04-10 21:23:03 +02:00
Fabio Manganiello
532217be12
Support for filtering entities by search string
2022-04-10 17:57:51 +02:00
Fabio Manganiello
f301fd7e69
Added standard NoItems component to handle visualization of no-results divs
2022-04-10 14:27:32 +02:00
Fabio Manganiello
58861afb1c
Added entities panel
2022-04-10 13:07:36 +02:00
Fabio Manganiello
8ec9c8f203
Added standard component for icons
2022-04-10 13:07:01 +02:00
Fabio Manganiello
3435f591eb
Support for keep-open-on-item-click and icon URLs on dropdown elements
2022-04-10 01:57:39 +02:00
Fabio Manganiello
19223bbbe1
Added SmartThings icon
2022-04-10 01:56:47 +02:00
Fabio Manganiello
453652ef76
Updated plugin icons
2022-04-10 01:50:45 +02:00
Fabio Manganiello
b2ff66aa62
Added mixins to capitalize/prettify text
2022-04-10 01:50:13 +02:00
Fabio Manganiello
655d56f4da
Upgraded font-awesome to 6.x
2022-04-10 01:49:14 +02:00
Fabio Manganiello
f52b556219
- icon_class should not be part of the backend model
...
- Interaction with entities should occur through the `entities.action`
method, not by implementing native methods on each of the model
objects
2022-04-08 16:49:47 +02:00
Fabio Manganiello
947b50b937
Added meta as a JSON field on the Entity table
...
Metadata attributes can now be defined and overridden on the object
itself, as well as on the database. Note that db settings will always
take priority in case of value conflicts.
2022-04-07 22:11:31 +02:00
Fabio Manganiello
db7c2095ea
Implemented meta property for entities (for now it only include `icon_class`)
2022-04-07 18:09:25 +02:00
Fabio Manganiello
e40b668380
Added missing docs
2022-04-07 01:49:13 +02:00
Fabio Manganiello
d3dc86a5e2
Added documentation for plugin/entity type registry
2022-04-07 01:47:42 +02:00
Fabio Manganiello
28026b0428
Trigger an EntityUpdateEvent when an entity state changes
2022-04-07 01:46:37 +02:00
Fabio Manganiello
44707731a8
Normalize UTC timezone on all the entity timestamps
2022-04-07 01:13:29 +02:00
Fabio Manganiello
948f37afd4
Filter by configured/enabled plugins when returning the entity/plugin registry
2022-04-07 01:04:06 +02:00
Fabio Manganiello
3b4f7d3dad
Added entities plugin to query/action entities
2022-04-07 00:22:54 +02:00
Fabio Manganiello
2eeb1d4fea
Entity objects are now JSON-able
2022-04-07 00:21:54 +02:00
Fabio Manganiello
26ffc0b0e1
Use Redis instead of an in-process map to store the entity/plugin registry
...
This is particularly useful when we want to access the registry from
another process, like the web server or an external script.
2022-04-07 00:18:11 +02:00
Fabio Manganiello
7b1a63e287
Make sure that flake8 and black don't step on each other's toes
2022-04-07 00:17:39 +02:00
Fabio Manganiello
1c6ff2fa49
(actually, the other way around is better)
2022-04-06 23:56:10 +02:00
Fabio Manganiello
d311629403
black validation should run before flake8
2022-04-06 23:48:27 +02:00
Fabio Manganiello
d52ae2fb80
Implemented RunnablePlugin.wait_stop() utility method
2022-04-05 23:33:02 +02:00
Fabio Manganiello
061268cdaf
Support for direct actions on native entities [WIP]
2022-04-05 23:22:54 +02:00
Fabio Manganiello
91ff47167b
Don't terminate the entities engine thread if a batch of entity records fails
2022-04-05 23:04:57 +02:00
Fabio Manganiello
fe0f3202fe
columns should be a property of the Entity object
2022-04-05 23:04:19 +02:00
Fabio Manganiello
8a70f1d38e
Replaced deprecated sqlalchemy.ext.declarative with sqlalchemy.orm
2022-04-05 22:47:44 +02:00
Fabio Manganiello
4b7eeaa4ed
Smarter merging of entities with the same key before they are committed
2022-04-05 21:17:58 +02:00
Fabio Manganiello
b43ed169c7
Added support for switches as native entities to zwave.mqtt plugin
2022-04-05 20:22:47 +02:00
Fabio Manganiello
0dac2c0e92
Fixed handling of possible null device definition in zigbee.mqtt
2022-04-05 00:31:04 +02:00
Fabio Manganiello
28b3672432
Added native support for switch entities to the zigbee.mqtt plugin.
2022-04-05 00:07:55 +02:00
Fabio Manganiello
9f2793118b
black fix
2022-04-04 22:43:04 +02:00
Fabio Manganiello
9d9ec1dc59
Added native support for switch entities to the smartthings plugin
2022-04-04 22:41:04 +02:00
Fabio Manganiello
b9c78ad913
Added native support for switch entities to switchbot.bluetooth plugin
2022-04-04 21:12:59 +02:00
Fabio Manganiello
91ff8d811f
Added native entities support in switchbot plugin
2022-04-04 20:56:28 +02:00
Fabio Manganiello
783238642d
Skip string and underscore normalization in black
2022-04-04 20:56:28 +02:00
Fabio Manganiello
53da19b638
Added entities engine support to WeMo switch plugin
2022-04-04 17:22:55 +02:00
Fabio Manganiello
7459f0115b
Added more pre-commit hooks
2022-04-04 17:22:54 +02:00
Fabio Manganiello
2c4c27855d
Added `.exception` action to logger plugin
2022-04-04 17:22:54 +02:00
Fabio Manganiello
9c25a131fa
get_bus() should return a default RedisBus() instance if the main bus is not registered
2022-04-04 17:22:54 +02:00
Fabio Manganiello
4ee7e4db29
Basic support for entities on the local db and implemented support for switch entities on the tplink plugin
2022-04-04 16:50:17 +02:00