-
Notifications
You must be signed in to change notification settings - Fork 55
no way to prevent state_set from removes existing attributes #9
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
Comments
I just made a commit 712692f that makes state setting preserve the attributes. |
This is released in 0.21. If you can suggest additional features or changes, please re-open this issue or create a new one. |
@craigbarratt And I suggested using the What do you think? |
Hi,
using
state.set("domain.entity", "new state")
removes existing attributes. It is possible to supply an attribute dict, but there was no way of collecting all existing attributes from a state.state.get()
only supported pulling a single attribute by name.Also
state_get()
would not return the full State object, but only the state as string or the attribute value.As a possible way to fix this, I did some changes:
states
object, known from template extensions to be the new way of simple state retrievalsget_new
that returns the actual State object and remappedstate.get()
to itset_new
that preserves existing attributes by default, but also allowes them to be updated or removedThe PR will follow soon.
The text was updated successfully, but these errors were encountered: