Commit Graph

5 Commits

Author SHA1 Message Date
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 8aedc3c233
Recursively normalize child entities in `EntityManager._normalize_entities` 2023-02-18 17:51:57 +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 35719b0da9
Let `publish_entities` return the list of transformed_entities 2023-02-08 02:09:34 +01:00
Fabio Manganiello be3b99326f
[WIP] Refactoring `@manages` annotation into a proper `EntityManager` hierarchy 2023-02-02 23:21:12 +01:00