-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Explicit entity object discovery, lifetimes, and registration #365
base: dev
Are you sure you want to change the base?
Conversation
This PR is "done" architecturally, for the most part. Main changes:
That about covers everything. This is a very, very rough first pass PR and is in not in a state for review beyond architecture changes. |
0f4faef
to
fb3dfd6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #365 +/- ##
==========================================
- Coverage 96.58% 96.40% -0.19%
==========================================
Files 61 61
Lines 9526 9594 +68
==========================================
+ Hits 9201 9249 +48
- Misses 325 345 +20 ☔ View full report in Codecov by Sentry. |
PlatformEntity
objects, among others, rely on implicit "registration" inside of__init__
by mutating a global dictionary that ZHA flushes when creating new devices. This is a bit difficult to work with, in my opinion, and is somewhat preventing zigpy/zigpy#1535 from being implemented.This PR:
on_add
interface to mirroron_remove
and allow for entity object creation to not rely on any sort of global state.Entity.is_supported
(this is mostly a copy/paste of thecreate_platform_entity
logic).gateway.py
.