Commit Graph

2661 Commits

Author SHA1 Message Date
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 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