-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
zha: Add remove service #11683
zha: Add remove service #11683
Conversation
@@ -125,7 +145,8 @@ def device_left(self, device): | |||
|
|||
def device_removed(self, device): | |||
"""Handle device being removed from the network.""" | |||
pass | |||
for entity in self._device_registry[device.ieee]: |
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.
import 'entity' from line 15 shadowed by loop variable
@@ -13,6 +14,7 @@ | |||
from homeassistant import const as ha_const | |||
from homeassistant.helpers import discovery, entity | |||
from homeassistant.util import slugify | |||
from homeassistant.util.async import run_coroutine_threadsafe |
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.
'homeassistant.util.async.run_coroutine_threadsafe' imported but unused
This seems to successfully remove a device, however, if I try to re-add the device without restarting home assistant, it complains that the entity already exists:
Any tips on what I'm missing? |
#10835 (and the forum post it references) seems to indicate that this is a limitation of hass if I'm reading it correctly. |
#11691 should help with the re-adding issue. |
Rebased on dev, and this now appears to work (including re-adding without restart). Thanks for adding a way to remove in core! |
Sounds good, thank you. |
Description:
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass