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

There is an implementation setStateChanged/setStateChangedAsync based on adapter.setForeignStateChanged. #1541

Merged
merged 5 commits into from Apr 4, 2024

Conversation

PeterVoronov
Copy link
Contributor

Notise: looks like the adapter.setForeignStateChanged use the state.ts value to compare, as result, it always be changed.
https://github.com/ioBroker/ioBroker.js-controller/blob/5f3c5bf6099dd086b20dcd9daf67e17ac5bcb31f/packages/adapter/src/lib/adapter/adapter.ts#L8000
There are two possibility to solve - to request change in ioBroker.js-controller, or make own comparison of new and old state attributes.

…ased on `adapter.setForeignStateChanged`.

Notise: looks like the `adapter.setForeignStateChanged` use the `state.ts` value to compare, as result, it always be changed.
https://github.com/ioBroker/ioBroker.js-controller/blob/5f3c5bf6099dd086b20dcd9daf67e17ac5bcb31f/packages/adapter/src/lib/adapter/adapter.ts#L8000
There are two possibility to solve - to request change in ioBroker.js-controller, or make own comparison of new and old state attributes.
…ased on `adapter.setForeignStateChanged`.

- fix the `state.ts` issue described in comments to the "Feature: function setState / setStateAsync only if not equal with oldState (setStateChanged)" ioBroker#1507
@klein0r
Copy link
Collaborator

klein0r commented Apr 3, 2024

Please add some integration tests to check if everything works as expected (since those changes are very complex)

lib/sandbox.js Fixed Show fixed Hide fixed
…ased on `adapter.setForeignStateChanged`.

-  integration tests for `setStateChanged` is added.
@PeterVoronov
Copy link
Contributor Author

Please add some integration tests to check if everything works as expected (since those changes are very complex)

Sure.
Done: ce5f071

…ased on `adapter.setForeignStateChanged`.

-  sync `javascript.md` with upstream master, to resolve conflicts
@klein0r klein0r merged commit e624d3f into ioBroker:master Apr 4, 2024
12 checks passed
@PeterVoronov PeterVoronov deleted the set_state_changed branch April 8, 2024 14:15
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