Skip to content
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

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

cdjackson
Copy link
Contributor

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 the ZigBeeThingHandler 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 a ZclCommandListener as it better integrates in with the server. Also requires further testing.

Signed-off-by: Chris Jackson [email protected]

@cdjackson cdjackson added this to the 3.3 milestone Jun 12, 2022
@cdjackson cdjackson force-pushed the firmware-provider branch 2 times, most recently from bce6eff to 7b3c600 Compare June 19, 2022 02:16
@openhab-bot
Copy link
Collaborator

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

@cdjackson cdjackson force-pushed the firmware-provider branch from 7b3c600 to ed01e93 Compare June 20, 2022 08:01
Copy link
Member

@kaikreuzer kaikreuzer left a 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>
Copy link
Member

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>
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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.
Copy link
Member

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;
Copy link
Member

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.

@kaikreuzer kaikreuzer changed the title WIP: Add ZigBee firmware provider backed by GitHub repository Add ZigBee firmware provider backed by GitHub repository Oct 15, 2022
pgaufillet pushed a commit to pgaufillet/org.openhab.binding.zigbee that referenced this pull request Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants