Compare commits

...

8 Commits

Author SHA1 Message Date
BWS Systems
f9e9f16756 Update Readme for RC2 2020-11-09 14:20:53 -05:00
BWS Systems
f15cc0d53a Merge pull request #1238 from bwssytems/dependabot/maven/junit-junit-4.13.1
Bump junit from 4.12 to 4.13.1
2020-11-09 13:08:53 -05:00
BWS Systems
0f791c1e71 Merge pull request #1249 from marcopollacci/dev_branch_5.3.x
Dev branch 5.3.x merge changes
2020-11-09 13:07:29 -05:00
Marco Pollacci
9887042f4d Update DeviceRepository.java 2020-11-06 10:26:00 +01:00
Marco Pollacci
c840f2bc4d Update DeviceResponse.java 2020-11-06 10:07:40 +01:00
dependabot[bot]
9a355b7906 Bump junit from 4.12 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 06:42:38 +00:00
BWS Systems
9399af7ec7 Merge pull request #1138 from jimirocks/proxy
Fix nginx example
2019-09-30 08:29:21 -05:00
Jiří Mikulášek
be72f7e62c Fix nginx example 2019-09-28 00:52:06 +02:00
5 changed files with 30 additions and 18 deletions

1
.gitignore vendored
View File

@@ -12,6 +12,7 @@ data
/.settings/ /.settings/
/start.bat /start.bat
/.classpath /.classpath
/.project
sftp-config\.json sftp-config\.json
/bin/ /bin/

View File

@@ -57,20 +57,20 @@ Then locate the jar and start the server with:
ATTENTION: Due to port 80 being the default, Linux restricts this to super user. Use the instructions below. ATTENTION: Due to port 80 being the default, Linux restricts this to super user. Use the instructions below.
``` ```
java -jar ha-bridge-5.3.1RC1.jar java -jar ha-bridge-5.3.1RC2.jar
``` ```
## Manual installation of ha-bridge and setup of systemd service ## Manual installation of ha-bridge and setup of systemd service
Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services. Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services.
Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
Create the directory and make sure that ha-bridge-5.3.1RC1.jar is in your /home/pi/ha-bridge directory. Create the directory and make sure that ha-bridge-5.3.1RC2.jar is in your /home/pi/ha-bridge directory.
``` ```
pi@raspberrypi:~ $ mkdir ha-bridge pi@raspberrypi:~ $ mkdir ha-bridge
pi@raspberrypi:~ $ cd ha-bridge pi@raspberrypi:~ $ cd ha-bridge
pi@raspberrypi:~/ha-bridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.3.1RC1/ha-bridge-5.3.1RC1.jar pi@raspberrypi:~/ha-bridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.3.1RC2/ha-bridge-5.3.1RC2.jar
``` ```
Create the ha-bridge.service unit file: Create the ha-bridge.service unit file:
@@ -89,7 +89,7 @@ After=network.target
Type=simple Type=simple
WorkingDirectory=/home/pi/ha-bridge WorkingDirectory=/home/pi/ha-bridge
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/ha-bridge/data/habridge.config /home/pi/ha-bridge/ha-bridge-5.3.1RC1.jar ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/ha-bridge/data/habridge.config /home/pi/ha-bridge/ha-bridge-5.3.1RC2.jar
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
@@ -222,7 +222,7 @@ proxy.server = (
``` ```
### nginx Example ### nginx Example
``` ```
location /api/ { location /api {
proxy_pass http://127.0.0.1:8080/api; proxy_pass http://127.0.0.1:8080/api;
} }
``` ```

View File

@@ -116,7 +116,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -17,6 +17,7 @@ public class DeviceResponse {
private String swversion; private String swversion;
private String swconfigid; private String swconfigid;
private String productid; private String productid;
private String productname;
public DeviceState getState() { public DeviceState getState() {
return state; return state;
@@ -90,6 +91,14 @@ public class DeviceResponse {
this.productid = productid; this.productid = productid;
} }
public String getProductName() {
return productname;
}
public void setProductName(String productname) {
this.productname = productname;
}
public String getLuminaireuniqueid() { public String getLuminaireuniqueid() {
return luminaireuniqueid; return luminaireuniqueid;
@@ -109,10 +118,11 @@ public class DeviceResponse {
if (device.isColorDevice()) { if (device.isColorDevice()) {
response.setType("Extended color light"); response.setType("Extended color light");
response.setModelid("LCT010"); response.setModelid("LCT015");
response.setSwversion("1.15.2_r19181"); response.setSwversion("1.46.13_r26312");
response.setSwconfigid("F921C859"); response.setSwconfigid("52E3234B");
response.setProductid("Philips-LCT010-1-A19ECLv4"); response.setProductid("Philips-LCT015-1-A19ECLv5");
response.setProductName("Hue color lamp");
} else { } else {
response.setType("Dimmable light"); response.setType("Dimmable light");
response.setModelid("LWB007"); response.setModelid("LWB007");
@@ -129,13 +139,14 @@ public class DeviceResponse {
response.setState(group.getAction()); response.setState(group.getAction());
response.setName(group.getName()); response.setName(group.getName());
response.setUniqueid("00:17:88:5E:D3:FF-" + String.format("%02X", Integer.parseInt(group.getId()))); response.setUniqueid("00:11:22:33:44:55:66:77-" + String.format("%02X", Integer.parseInt(group.getId())));
response.setManufacturername("Philips"); response.setManufacturername("Philips");
response.setType("Extended color light"); response.setType("Extended color light");
response.setModelid("LCT010"); response.setModelid("LCT015");
response.setSwversion("1.15.2_r19181"); response.setSwversion("1.46.13_r26312");
response.setSwconfigid("F921C859"); response.setSwconfigid("52E3234B");
response.setProductid("Philips-LCT010-1-A19ECLv4"); response.setProductid("Philips-LCT015-1-A19ECLv5");
response.setProductName("Hue color lamp");
response.setLuminaireuniqueid(null); response.setLuminaireuniqueid(null);

View File

@@ -188,7 +188,7 @@ public class DeviceRepository extends BackupHandler {
nextId++; nextId++;
} }
if (descriptors[i].getUniqueid() == null || descriptors[i].getUniqueid().length() == 0) { if (descriptors[i].getUniqueid() == null || descriptors[i].getUniqueid().length() == 0) {
descriptors[i].setUniqueid("00:17:88:5E:D3:" + hueUniqueId(Integer.valueOf(descriptors[i].getId()))); descriptors[i].setUniqueid("00:11:22:33:44:55:66:" + hueUniqueId(Integer.valueOf(descriptors[i].getId())));
} }
put(descriptors[i].getId(), descriptors[i]); put(descriptors[i].getId(), descriptors[i]);
theNames = theNames + " " + descriptors[i].getName() + ", "; theNames = theNames + " " + descriptors[i].getName() + ", ";
@@ -228,7 +228,7 @@ public class DeviceRepository extends BackupHandler {
} }
} }
theDevice.setId(String.valueOf(nextId)); theDevice.setId(String.valueOf(nextId));
theDevice.setUniqueid("00:17:88:5E:D3:" + hueUniqueId(nextId)); theDevice.setUniqueid("00:11:22:33:44:55:66:" + hueUniqueId(nextId));
nextId++; nextId++;
} }
newdevices.put(theDevice.getId(), theDevice); newdevices.put(theDevice.getId(), theDevice);
@@ -320,4 +320,4 @@ public class DeviceRepository extends BackupHandler {
return theUniqueId; return theUniqueId;
} }
} }