-
Notifications
You must be signed in to change notification settings - Fork 17
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
Extend dump to include full deviceclass object #136
Conversation
What's the reason for not including the full state as described here? |
Well because we will have to replicate that entire object and no use ? |
Like just discussed on discord with @AlCalzone the json serializations of most objects only return the string/label so we need to dump each individual object |
Ok. |
also included the list of supported commandClasses in the dump, this fixes #75
|
If we miss any values we can add it to the (custom) state object too. |
): CommandClassState => ({ | ||
id: commandClass.ccId, | ||
name: CommandClasses[commandClass.ccId], | ||
version: commandClass.version, |
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.
I guess whether this CC is secure or not is of no interest to HA, but it could be useful for debugging.
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.
I guess whether this CC is secure or not is of no interest to HA, but it could be useful for debugging.
I can add it. How to access it from the CommandClass instance ?
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.
nvm, got it
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.
The empty interfaces look a bit weird (I'd use plain types for that). Otherwise LGTM
Yeah, we tend to override/extend from the original interfaces so it will break (intentionally) when upstream changes so we keep up with the changes instead of things silently breaking. But if you have any good ideas to deal with it, let me know! |
I mean instead of interface Foo extends SomeGeneric<Bar> {} I'd do type Foo = SomeGeneric<Bar> |
@AlCalzone adjusted it. |
BREAKING CHANGE
DeviceClass strings tend to change sometimes which is annoying as our discovery scheme in HA depends a lot on these deviceclass id's.
This change replaces the deviceClass to a full object containing both the key and label.
Discussed with @MartinHjelmare that we should do this breaking change before HA beta release (and adjust both integration and the lib for this change).
Closes #76
Closes #75
The dump will look like this after this change: