Commit graph

1333 commits

Author SHA1 Message Date
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
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
9951d62511
Added logic to automatically generate the secret key for Flask. 2023-05-06 22:04:48 +02:00
e33a391d25
Updated dist files 2023-05-06 12:37:00 +02:00
4f78d61223
Improved UI on mobile. 2023-05-06 12:34:27 +02:00
6e939bbe62
Close modals and dropdown when ESC is pressed. 2023-05-05 20:46:42 +02:00
e9e59c857a
Updated dist files 2023-05-05 02:51:33 +02:00
59bf1c2aa0
Added close button to the modal's header. 2023-05-05 02:48:41 +02:00
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
98b9d31dd4
Updated dist files 2023-05-05 01:10:24 +02:00
4383dbb2b4
Bluetooth UI toggle aligned to the right - like all other toggles. 2023-05-05 01:04:39 +02:00
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
99311a6e71
Updated dist files 2023-05-04 02:23:24 +02:00
7db09276ca
Some small style improvements. 2023-05-04 02:20:40 +02:00
2398cac572
A more efficient and clean logic for selectedEntities calculation. 2023-05-04 02:19:55 +02:00
394e27eaf2
Refactored style for UI dropdowns. 2023-05-04 02:19:09 +02:00
5d1c8cf8e9
Additional null check on this.searchTerm 2023-05-03 03:33:34 +02:00
3482c29679
Updated dist files 2023-05-03 03:18:44 +02:00
a06d0ef6a1
Merged all the items in the entities panel's header in the Selector component. 2023-05-03 03:14:46 +02:00
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
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
cc2ec1db7f
The HTTP Zeroconf service should be registered before the server starts. 2023-05-02 21:24:50 +02:00
55cb87d14f
Updated dist files 2023-05-02 10:24:11 +02:00
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
0fc0a22cd7
Reintroduced loading icon spin animation. 2023-05-02 10:08:36 +02:00
de76c2b6a8
Updated dist files 2023-05-01 10:12:43 +02:00
835ad9f2dc
Use plugin as a default entity grouping instead of category 2023-05-01 10:06:11 +02:00
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
24c6b7b377
Updated dist files 2023-05-01 01:25:27 +02:00
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
a3839e637d
Set a max-width: 600px for group containers. 2023-05-01 01:22:02 +02:00
1e43866978
Moved more entity common CSS out of the Vue component. 2023-05-01 01:21:18 +02:00
de84a65a22
Show prettified entity type when hover the entity icon. 2023-05-01 01:20:31 +02:00
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
d1066ba624
Use Math.round instead of parseInt when parsing durations. 2023-04-30 16:22:37 +02:00
94a493580c
Updated dist files 2023-04-30 01:36:13 +02:00
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
52f036dc1d
Updated dist files 2023-04-29 22:49:35 +02:00
cbf0ea8a19
Style fixes for mobile screens. 2023-04-29 22:45:10 +02:00
b4048002b9
Updated dist files 2023-04-29 18:21:32 +02:00
6d9c34f06f
Added VariableModal to set variables from the dashboard. 2023-04-29 18:20:41 +02:00
38c87ef39f
Added frontend component for the Variable entity. 2023-04-29 11:37:21 +02:00
7685521e2b
Always use the default configuration values for MQTT listeners if not specified 2023-04-26 03:30:05 +02:00
ee54e0edbf
Use a font-awesome spinner instead of an animated gif when loading entities 2023-04-25 16:42:01 +02:00
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
e955ffc018
Be more resilient in DateTimeWeather widget about custom temperature/humidity names or non-numeric data 2023-04-24 12:48:51 +02:00
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
512ced3e94
Updated dist files 2023-04-23 02:13:48 +02:00
6439e235d2
Updated caniuse dependency 2023-04-23 02:11:21 +02:00
259b42bdd6
Removed legacy backend.sensor.battery. 2023-04-23 00:44:03 +02:00
a72c32cb00
Added battery entity support to system plugin. 2023-04-23 00:41:21 +02:00
b3440ab96b
Added support for fan sensors on the system plugin. 2023-04-23 00:08:27 +02:00
45d5f439be
Added support for system temperature sensor entities. 2023-04-22 22:42:11 +02:00
374f936c1f
Merged network_stats into NetworkInterface model. 2023-04-22 17:19:24 +02:00
f4036be52b
Extracted and refactored more common elements of the Entity components. 2023-04-22 17:19:23 +02:00
977b55dea9
Merged network addresses into NetworkInterface model. 2023-04-22 17:19:23 +02:00
98a300c4b1
Added NetworkInterface entities to system plugin.
Plus, `platypush.schemas.system` has now been split into multiple
submodules to avoid a single-file mega-module with all the system
schemas definitions.
2023-04-21 00:45:15 +02:00
44b8fd4b34
Support for disk entities in the system integration. 2023-04-20 16:26:51 +02:00
6b03451386
Better responsive alignment for the collapse toggler. 2023-04-20 16:26:05 +02:00
e8c96ad35d
Added convertTime utility function 2023-04-20 02:27:58 +02:00
153d03d43f
Moved CPU percentage on the level of the CPU entity instead of a child entity. 2023-04-19 01:48:05 +02:00
4ebfbf3851
Added memory stats entities. 2023-04-19 01:31:11 +02:00
1cee0459cf
Added CpuFrequency entity to system. 2023-04-18 01:49:36 +02:00
a5b0a524f6
Added CpuStats entity to system. 2023-04-18 01:19:06 +02:00
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
e810025a6d
Added Cpu and CpuTimes entities. 2023-04-17 02:25:03 +02:00
65481dc6b4
Added PercentSensor entity type. 2023-04-17 02:25:02 +02:00
186a21f715
Added CpuInfo entity frontend components. 2023-04-17 02:25:01 +02:00
d5ddc0c65e
Migrated arduino integration to the new SensorPlugin API. 2023-04-03 01:36:12 +02:00
cf16076bce
Added icons for new entity sensor sources. 2023-04-03 01:36:11 +02:00
ac2ec58f89
Migrated mcp3008 integration to the new SensorPlugin API. 2023-04-03 01:36:11 +02:00
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
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
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
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
a3f4b21478
Updated dist files 2023-04-02 03:24:11 +02:00
e6e5dec088
Updated dist files 2023-04-02 02:56:09 +02:00
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
5a6f4bcf57
Added 3-axis sensor, accelerometer and magnetometer entities 2023-04-02 01:13:22 +02:00
d964167631
s/TimeDurationSensor/TimeDuration/g 2023-04-02 00:57:48 +02:00
839c6108a0
Added sensor.* icon classes 2023-04-02 00:40:50 +02:00
429893ddbf
Updated dist files 2023-04-01 23:58:28 +02:00
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
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
bf4db76830
Legacy sensor backend replaced by an extended sensor runnable plugin. 2023-04-01 19:24:35 +02:00
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
2a8a3f4394 Removed legacy sensor.distance.vl53l1x backend 2023-03-31 14:26:14 +02:00
226034946f Added distance_sensor entity 2023-03-31 14:22:28 +02:00
c2f9ebf4ed
Updated dist files 2023-03-27 01:47:29 +02:00
cf91ab90df
Increased default width of nav on desktop+ 2023-03-26 23:10:46 +02:00
89bc54da22
Updated dist files 2023-03-26 12:30:46 +02:00
295758bb20
Added frontend components for cloud instances. 2023-03-26 12:27:17 +02:00
bc2730c841
Rewritten linode integration.
- Support for cloud instances as native entities.
- Using Marshmallow dataclasses+schemas instead of custom `Response`
  objects.
- Merge `linode` backend into `linode` plugin.
2023-03-26 11:23:33 +02:00
a71017df33
Updated web app files 2023-03-24 16:45:55 +01:00
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
f49b866a51
Focus the <input> element when a <NameEditor> element is created. 2023-03-22 21:28:21 +01:00
dd80dc998c
Show entity icon and type in the list of children entities on EntityModal. 2023-03-22 21:26:59 +01:00
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
5dd95362a1
Include links both to the parent and children entities in EntityModal. 2023-03-22 16:20:29 +01:00
486f37a45e
Support sensor value reported both on value as well as _value fields. 2023-03-22 14:11:13 +01:00