Skip to content
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

Merged
merged 3 commits into from
Apr 25, 2021

Conversation

manup
Copy link
Member

@manup manup commented Apr 15, 2021

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:

  1. Permit Join is enabled and messages are received from an unknown node (Device Announce etc.);
  2. A device table entry exists and a Node Descriptor can be retrieved from device_descriptors table or as fallback from older session.default file;
  3. A not deleted entry in nodes or sensors 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.

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.
@manup manup requested review from ebaauw and SwoopX April 15, 2021 18:41
@manup manup changed the title Relax creation of light nodes Improve lights and sensor deletion and relax creation of light nodes Apr 15, 2021
Copy link
Collaborator

@ebaauw ebaauw left a 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.

@manup
Copy link
Member Author

manup commented Apr 16, 2021

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 --always-add-lights=1 command line parameter to enable this if needed (I used that a few times to fix some larger installations remotely).

@manup manup changed the title Improve lights and sensor deletion and relax creation of light nodes Improve lights and sensor deletion Apr 16, 2021
Since the --always-add-lights commandline parameter exists this can be enabled if needed without causing confusion.
@manup
Copy link
Member Author

manup commented Apr 22, 2021

@ebaauw I think the PR can be merged now, since it only now only handles proper deletion of light and sensor nodes.

@manup manup requested a review from ebaauw April 25, 2021 11:05
@manup manup added this to the v2.11.2-beta milestone Apr 25, 2021
@manup manup merged commit 0e0bbb8 into dresden-elektronik:master Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants