mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-18 00:10:20 +00:00
Update broadlinnk to dump clients when discovered in debug and to drop
clients when re-init.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>5.2.0RC9</version>
|
<version>5.2.0RC10</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -76,8 +76,12 @@ public class BroadlinkHome implements Home {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
for(int i = 0; i < clients.length; i++) {
|
for(int i = 0; i < clients.length; i++) {
|
||||||
if(clients[i].getDeviceType() != BLDevice.DEV_A1)
|
if(clients[i].getDeviceType() != BLDevice.DEV_A1) {
|
||||||
broadlinkMap.put(clients[i].getHost() + "-" + String.format("%04x", clients[i].getDeviceType()), clients[i]);
|
broadlinkMap.put(clients[i].getHost() + "-" + String.format("%04x", clients[i].getDeviceType()), clients[i]);
|
||||||
|
log.debug("Adding Device to Map - host: " + clients[i].getHost() + ", device Type: " + clients[i].getDeviceDescription() + ", mac: " + (clients[i].getMac() == null ? "no Mac in client" : clients[i].getMac().getMacString()));
|
||||||
|
} else {
|
||||||
|
log.debug("Ignoring A1 Device - host: " + clients[i].getHost() + ", device Type: " + clients[i].getDeviceDescription() + ", mac: " + (clients[i].getMac() == null ? "no Mac in client" : clients[i].getMac().getMacString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.warn("Could not discover Broadlinks, with IO Exception", e);
|
log.warn("Could not discover Broadlinks, with IO Exception", e);
|
||||||
@@ -300,6 +304,8 @@ public class BroadlinkHome implements Home {
|
|||||||
if(!validBroadlink)
|
if(!validBroadlink)
|
||||||
return;
|
return;
|
||||||
log.debug("Closing Home.");
|
log.debug("Closing Home.");
|
||||||
|
broadlinkMap.clear();
|
||||||
|
broadlinkMap = null;
|
||||||
if(closed) {
|
if(closed) {
|
||||||
log.debug("Home is already closed....");
|
log.debug("Home is already closed....");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user