-
Notifications
You must be signed in to change notification settings - Fork 4k
Added: covers mode (SBDV-00199), diagnostics (SBDV-00196,00199,00202) #9958
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
Added: covers mode (SBDV-00199), diagnostics (SBDV-00196,00199,00202) #9958
Conversation
src/devices/sber.ts
Outdated
| return false; | ||
| } | ||
| function setMetaOption(device: Zh.Device, key: string, enabled: boolean) { | ||
| if (device != null && key != null) { |
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 think this check is not needed?
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 think you are right, this additional check was an artefact from times when dummyDevice was not implemented yet
src/devices/sber.ts
Outdated
| } | ||
| function setMetaOption(device: Zh.Device, key: string, enabled: boolean) { | ||
| if (device != null && key != null) { | ||
| device.meta[key] = enabled; |
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.
| device.meta[key] = enabled; | |
| device.meta[key] = enabled; | |
| device.save(); |
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.
done. Also got rid of extra functions
src/devices/sber.ts
Outdated
| const defaultResponseOptions = {disableDefaultResponse: false}; | ||
|
|
||
| function checkMetaOption(device: Zh.Device, key: string) { | ||
| if (device != null) { |
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.
This check should not be needed? I think this function can be simplified to just return !!(device.meta[key] ?? false)
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.
OK
|
Thanks! |
…agnostics (Koenkk#9958) Co-authored-by: Koen Kanters <[email protected]>
Adding new features for devices from SDevices:
PR with additional information about switching SBDV-00199 into covers mode: Koenkk/zigbee2mqtt.io#4126