-
Notifications
You must be signed in to change notification settings - Fork 482
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
Improve lights and sensor deletion #4777
Improve lights and sensor deletion #4777
Conversation
Don't store entries with state 'deleted'. This purges a device completely. Since deCONZ 2.10.4 deCONZ::Node won't be created if neither of these entries exist to prevent reappearance of delted nodes.
Since deCONZ 2.10.4 reappearance of deleted nodes is fixed. Which means that deCONZ::Node is only created under stricter conditions, see dresden-elektronik#4772 This PR enabled creation of light nodes even if light search isn't running anymore, but minimal required data has already been queried from the device (Node Descriptor and Simple Descriptors). The reason this came up is that in larger installations where >100 devices where joined sucessfully and appeared in the GUI wheren't processed completely and light resources where missing albeit the device was already joined during a Permit Join enabled phase.
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.
This PR also enables creation of light nodes even if light search isn't running anymore, but minimal required data has already been queried from the device (Node Descriptor and Simple Descriptors).
So now if permit join is set from the GUI, the deCONZ::Node will be created on e.g. Device Announce, the core will read the descriptors and the API will create the /lights
resources, but not the /sensors
resources? Also, for end devices, the /lights
resource might be created at a seemingly random time, when the descriptors can (finally) be read when it polls its parent? That could cause a lot of confusion.
Indeed, I haven't thought about the "non-light" light resources. I think it shouldn't happen in practice but to be safe this part is now removed from the PR. Note there is already a |
Since the --always-add-lights commandline parameter exists this can be enabled if needed without causing confusion.
a5cc211
to
0d00ac4
Compare
@ebaauw I think the PR can be merged now, since it only now only handles proper deletion of light and sensor nodes. |
When deleting a light or sensor, don't store entries with state 'deleted' but purge a device completely.
Since deCONZ 2.10.4 one of the following conditions must be met to create a
deCONZ::Node
:device
table entry exists and a Node Descriptor can be retrieved fromdevice_descriptors
table or as fallback from oldersession.default
file;nodes
orsensors
tables exist.This is done in order to prevent reappearance of deleted nodes.
This PR also enables creation of light nodes even if light search isn't running anymore, but minimal required data has already been queried from the device (Node Descriptor and Simple Descriptors).The reason this came up is that in larger installations where >100 devices where joined successfully and appeared in the GUI some of these weren't processed completely and light resources where missing albeit the device was already joined during a Permit Join enabled phase.