-
-
Notifications
You must be signed in to change notification settings - Fork 112
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 ZigBee firmware provider backed by GitHub repository #767
Conversation
bce6eff
to
7b3c600
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/ikea-tradfri-firmware-updates/132042/63 |
7b3c600
to
ed01e93
Compare
Signed-off-by: Chris Jackson <[email protected]>
ed01e93
to
994832b
Compare
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.
@cdjackson Although this is already merged, I have some review comments - most importantly that it broke our build, so it would be much appreciated to have this addressed.
<artifactId>org.openhab.binding.zigbee.xbee</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> |
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.
Please fix the indentation here.
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.zigbee.reactor</artifactId> | ||
<version>3.3.0-SNAPSHOT</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.
This seems to break our release build (https://ci.openhab.org/view/Sandbox/job/sandbox-openhab3-release/) since October 11 - it should clearly be 3.4.0-SNAPSHOT
.
@@ -0,0 +1,156 @@ | |||
/** | |||
* Copyright (c) 2010-2021 Contributors to the openHAB project |
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 you please update all headers to 2010-2022?
directoryReader.create("https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master"); | ||
directoryReader.updateRemoteDirectory(); | ||
} catch (Exception e) { | ||
// TODO Auto-generated catch block |
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.
Please remove the TODO and replace the printStackTrace by a logging statement.
@@ -0,0 +1,189 @@ | |||
/** | |||
* Copyright (c) 2018-2021 by Z-Smart Systems Ltd. |
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 you please use the standard openHAB license header instead (on all new classes)?
outputStream.close(); | ||
} catch (FileNotFoundException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); |
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.
Please replace with logging statements.
e.printStackTrace(); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); |
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.
Please replace with logging statements.
return inputStream; | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); |
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.
Please replace with logging statements.
|
||
## Device Firmware Updates | ||
|
||
A *Firmware Provider*, backed by the [Koenkk OTA](https://github.com/Koenkk/zigbee-OTA) repository on GitHub can be used to upgrade device firmware. This *Firmware Provider* provides firmware to the openHAB firmware management system. Since there is no information linking firmware to a device, Zigbee devices must ask for a firmware update, and when this happens, the *Firmware Provider* will use the information in this request to check to see if there is firmware available, and if there is it will download this to a local file in the *Userdata* folder. It will also advise the openHAB firmware management system that there is firmware available to upload, and the user can manage this appropriately. |
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.
Please add a newline after every sentence.
@@ -0,0 +1,77 @@ | |||
package org.openhab.binding.zigbee.handler; |
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.
Please add a license header.
Signed-off-by: Chris Jackson <[email protected]>
This PR implements a
FirmwareProvider
for Zigbee devices. It gets the firmware files from the web and caches them locally for use based on requests from the device. The provider gets the firmware IDs from theZigBeeThingHandler
based on these periodic requests from the device, and provides them as a list so the user can allow the upgrade via the standard OH firmware management system.Requires an updated ZSS
1.4.7
library to provide callback when the client sends a request. This is a little cleaner than the other approach of adding aZclCommandListener
as it better integrates in with the server. Also requires further testing.Signed-off-by: Chris Jackson [email protected]