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
Set the default link key #257
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
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.
In general, this looks good to me.
I added two small comments, you could check whether you want to add those small improvements to the PR, then I can approve again.
org.openhab.binding.zigbee/README.md
Outdated
|
||
The key is defined as 16 hexadecimal values. If not defined, this will default to the well known ZigBee HA link key. | ||
|
||
If defined with the work ```INSTALLCODE:``` before the key, then this will create a link key from an install code which may be shorter than 16 bytes. |
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.
Could these be typos?
with the work
->with the word
before the key, then this will
->before the key, this will
try { | ||
logger.debug("Link Key String {}", linkKeyString); | ||
linkKey = new ZigBeeKey(linkKeyString); | ||
} catch (IllegalArgumentException e) { |
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.
Minor suggestion: Add a log statement within the catch
block, so that it gets visible in the log that (and why) the system falls back to the well-known key.
That the system fell back to the well-known key is also visible (though somewhat implicit) from the log statement with the final link key array, the additional log statement would make this more explicit.
linkKey = new ZigBeeKey(linkKeyString); | ||
} catch (IllegalArgumentException e) { | ||
linkKey = KEY_ZIGBEE_ALLIANCE_O9; | ||
logger.debug("Link Key String has invalid format. Revert to default key.", linkKeyString); |
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 believe the {}
placeholder for the linkKeyString
parameter is missing in the log string.
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.
Thanks - cut and paste error ;)
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Thanks for the update, looks good to me. |
Recent Ember dongle driver does not set the default link key, so at the moment, the link key won't be set during initialisation. Other dongles should also be updated in future so this ensures the standard link key is set.
Signed-off-by: Chris Jackson chris@cd-jackson.com