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
Add hash magic method to driver, controller, nodes and values #134
Add hash magic method to driver, controller, nodes and values #134
Conversation
… node in value repr
Shouldn't you be adding a hash method for this ?
|
The default hash for custom objects isn't based on |
OK so keep the representation as is and just improve the hash? |
I think that is better, future wise but like @MartinHjelmare said there is no direct issue atm. |
If we always reload the complete state when starting the listen, is there a case when the nodes' native instance id won't be unique? |
I think it could only be an issue if we instantiate Z-Wave Nodes from the model not driven by the controller logic like for compare actions or something like that. Better be safe than sorry and add in the small hash method, creating the hash based on home id and node id and it's all good. |
so hash has been added, revert repr changes or no? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
As part of this discussion: home-assistant/core#46673 (comment) we realized that our representation for various models is not unique enough. This make controller, node, and value representations unique so they can be usefully hashed.
Without this, you cannot use the zwave_js.set_config_parameter on entities from two different config entries with the same node ID