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

[1.5] delState also deletes the object #268

Closed
AlCalzone opened this issue Nov 5, 2018 · 9 comments
Closed

[1.5] delState also deletes the object #268

AlCalzone opened this issue Nov 5, 2018 · 9 comments

Comments

@AlCalzone
Copy link
Collaborator

See the video in AlCalzone/ioBroker.tradfri#59 for an example.

The tradfri adapter sets the value of group states to null if the individual lights of a group have different values for said state.

I'm not 100% what happens here but it seems that in v1.5.3, this leads to the objects and/or states being deleted

@AlCalzone AlCalzone changed the title Bug in 1.5.x: Setting a state's value to null deletes the object Bug in 1.5.x: Setting a state's value to null may delete the object Nov 5, 2018
@Apollon77 Apollon77 added this to the 1.5 milestone Nov 16, 2018
@foxriver76
Copy link
Collaborator

I am not able to reproduce this behavior by setting a state to null with the current master branch and also not with 1.6.0 dev branch. The state in admin objects just shows an empty field for the value or when unit is set it e.g. shows null %. Is there something else special in the setting where this happens except writing a null value?

@AlCalzone
Copy link
Collaborator Author

It happens in tradfri starting with controller 1.5.

@Apollon77
Copy link
Collaborator

latest 1.5 github? there was something in earlier 1.5 version that coud interfere like this!

@AlCalzone
Copy link
Collaborator Author

I need to try again, but I currently have the bug on my production system which is running sth newer - maybe even the dev branch

@Apollon77
Copy link
Collaborator

Ok then we need to check 1.6.0-dev and maybe recheck 1.5 afterwards

@AlCalzone
Copy link
Collaborator Author

See #203 (comment)

The problem is that I don't set the state to null but rather call delState to avoid showing null % in the UI.
Prior to (#203) this used to only delete the state, not the object. Now it does both. IMO this is not the correct behavior since objects are able to exist without states. And there can be state objects whose corresponding states do not exist yet.

I propose reverting the change to delState to restore the old behavior - what do you think?

@Apollon77
Copy link
Collaborator

After thinking I would see it like @AlCalzone ... delState should only clear the value (as it did before). I also see this as a needed functionality e.g. when restructuring states in an adapter and adding a new substructure under the nbame of a former state ... sometime you want to remove the value from such a new channel object or so ...

@Apollon77 Apollon77 changed the title Bug in 1.5.x: Setting a state's value to null may delete the object [1.5] Setting a state's value to null may delete the object Jan 3, 2019
@foxriver76
Copy link
Collaborator

Of course delState should only delete the state, otherwise there exists delObject. So no unexpected behavior by setting states to null but on deletion of states. ;-)

@Apollon77 Apollon77 changed the title [1.5] Setting a state's value to null may delete the object [1.5] delState also deletes the object Jan 3, 2019
@Apollon77
Copy link
Collaborator

fixed by #295/#296

foxriver76 pushed a commit to foxriver76/ioBroker.js-controller that referenced this issue May 4, 2021
German Doku, named latest repo as beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants