-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Modernize Huawei LTE #26675
Modernize Huawei LTE #26675
Conversation
- config entry support, with override support from huawei_lte platform in YAML - device tracker entity registry support - refactor for easier addition of more features - internal code cleanups
No longer needed, because pretty much all keys from supported categories are exposed as sensors. Closes #23819
So, here's a work in progress rework of the whole shebang, using entities disabled on discover, and entity enablement. Appears to work in principle, but I'm seeing some issues (see the "Work in progress" section). |
Also, the passing of system_options to disable new entities when creating the config entry requires #27044 to be applied first. |
That happens when Home Assistant does the reload. Apparently your integration does not deal with reloads well. You need to make sure that when an entry is unloaded, you unload and detach all things that you set up. You should not return from that method until it is all set up. So don't create task but await the forward unload calls. |
So when you re-enable an entity, Home Assistant doesn't know where that entity is, nor can it instantiate it. So what happens is that we wait up to 30 seconds after the last change and then reload the integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good I think. Beware of async vs sync context.
Thanks a lot for the assistance, I'll address rest of the comments a bit later. |
Ok, with this batch of commits, stuff appears to work fine. Reload woes were because I was inadvertently using a mutable default defaultdict for all router instances (filed a couple of related pylint RFE's right after that), and there were some other less significant ones here and there. I believe this is pretty much in a shape for inclusion now, still pending #27044 or similar, and the |
Way to set |
Tweaked to enable a small known subset of sensors by default, no longer requires #27612. |
Should be good to go now. |
Re better snakecase: okunishinishi/python-stringcase#18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Breaking Change:
Configuration has been consolidated below
huawei_lte
.Device tracker no longer uses
known_devices.yaml
but entity registry.Description:
Modernize Huawei LTE quite a bit, config entry support, unauthenticated access.
Related issue (if applicable): fixes #23819
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10380
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: