Fixed 3 bugs (#8584)

Fixed 3 bugs:
- Network bridge not listening on bus
- Reconnection handler keeps reconnecting even after a successful reconnection
- Minor typo in alarm wakeup time channels

Signed-off-by: Cedric Boon <cedric.boon@hotmail.com>
This commit is contained in:
cedricboon 2020-09-27 23:20:25 +02:00 committed by GitHub
parent d716d03787
commit d5f6bd326c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -253,8 +253,9 @@ public abstract class VelbusBridgeHandler extends BaseBridgeHandler {
int reconnectionInterval = bridgeConfig.reconnectionInterval;
if (reconnectionInterval > 0) {
this.reconnectionHandler = scheduler.scheduleWithFixedDelay(() -> {
if (connect() && reconnectionHandler != null) {
reconnectionHandler.cancel(false);
final ScheduledFuture<?> currentReconnectionHandler = this.reconnectionHandler;
if (connect() && currentReconnectionHandler != null) {
currentReconnectionHandler.cancel(false);
}
}, reconnectionInterval, reconnectionInterval, TimeUnit.SECONDS);
}

View File

@ -63,12 +63,6 @@ public class VelbusNetworkBridgeHandler extends VelbusBridgeHandler {
updateStatus(ThingStatus.ONLINE);
logger.debug("Bridge online on network address {}:{}", networkBridgeConfig.address,
networkBridgeConfig.port);
return true;
} catch (IOException ex) {
onConnectionLost();
logger.debug("Failed to connect to network address {}:{}", networkBridgeConfig.address,
networkBridgeConfig.port);
}
// Start Velbus packet listener. This listener will act on all packets coming from
// IP-interface.
@ -76,6 +70,13 @@ public class VelbusNetworkBridgeHandler extends VelbusBridgeHandler {
thread.setDaemon(true);
thread.start();
return true;
} catch (IOException ex) {
onConnectionLost();
logger.debug("Failed to connect to network address {}:{}", networkBridgeConfig.address,
networkBridgeConfig.port);
}
return false;
}

View File

@ -1338,7 +1338,7 @@
<label>Clock Alarm 1 Wakeup Hour</label>
</channel>
<channel id="clockAlarm1WakeupMinute" typeId="minute">
<label>Clock Alarm 1 Minute</label>
<label>Clock Alarm 1 Wakeup Minute</label>
</channel>
<channel id="clockAlarm1BedtimeHour" typeId="hour">
<label>Clock Alarm 1 Bedtime Hour</label>