Track devices that join the network after startup - #157
Open
LightD31 wants to merge 2 commits into
Open
Conversation
This repository was started from a component template and some strings still name the components it was copied from: - pyproject.toml describes the project as the Google Home integration - the prettier pre-commit hook excludes custom_components/google_home/ manifest.json, a path that does not exist here, so glinet's manifest.json is not actually excluded - button.py and switch.py carry Pi-hole module and function docstrings No behaviour changes.
GLinetRouter dispatches signal_device_new when polling finds a client it has not seen before (router.py:368), but device_tracker.async_setup_entry never subscribed to it: it called update_router() once at setup and then nothing again. Devices that joined the network later got no tracker entity until the config entry was reloaded or Home Assistant restarted. Connect update_router to the signal, unsubscribing on unload.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GLinetRouterdispatchessignal_device_newwhen polling finds a client it has not seen before (router.py:368), butdevice_tracker.async_setup_entrynever subscribed to it. It calledupdate_router()once at setup and then nothing again.The effect: devices that join the network after Home Assistant starts get no tracker entity until the config entry is reloaded or HA restarts.
This connects
update_routerto the signal, unsubscribing on unload. Independent of PR 1; a test covering it comes with the test-suite PR.