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

attribute changes not detected #578

Open
Kaptensanders opened this issue Jan 26, 2024 · 0 comments
Open

attribute changes not detected #578

Kaptensanders opened this issue Jan 26, 2024 · 0 comments

Comments

@Kaptensanders
Copy link

Hi, have had a headscratcher with this one. Not 100% sure if the error is with pyscript or HA, but the workaround is done from pyscript so...

Using HA Core, 2023.10.5
Frontend 20231005.0
Pyscript 1.5.0

changes to entity attributes (like pyscript.myentity) from pyscript code, are only detected and available to the frontend when they are made on the top-level of the attributes data structure.

#pyscript.myentity attributes:
{
  "key1" : "changes to this one is detected",
  "key2" : { "key21": "changes here are not detected" }
}

The data is for sure changed, and is published to the frontend after a delay when attributes data has been refreshed for some reason, but it seems either pyscript or homeassistant does not discover that the data has been modified and forces a refresh to the frontend immediately.

The only way I found around this was to replace the entire attributes dict with a deepcopy to the state.set function.

Thanks for all the work!
Anders

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

No branches or pull requests

1 participant