Commit Graph

19 Commits

Author SHA1 Message Date
Fabio Manganiello 0edd73690b
Modelling of parent/children relationships on entity level 2022-11-28 21:36:00 +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 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 02a4c9f667
Added is_query_disabled attribute to entities 2022-11-11 20:40:36 +01:00
Fabio Manganiello 041f64c80f
Dirty workaround to prevent redefinition of SQLAlchemy ORM model classes 2022-10-10 01:38:15 +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 1df71cb54a
Proper support for light entities on smartthings 2022-05-30 09:23:05 +02:00
Fabio Manganiello 7df67aca82
updated_at should have utcnow() onupdate, not now() 2022-04-30 01:48:55 +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 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 44707731a8
Normalize UTC timezone on all the entity timestamps 2022-04-07 01:13:29 +02:00
Fabio Manganiello 2eeb1d4fea
Entity objects are now JSON-able 2022-04-07 00:21:54 +02:00
Fabio Manganiello 061268cdaf
Support for direct actions on native entities [WIP] 2022-04-05 23:22:54 +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 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