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; int reconnectionInterval = bridgeConfig.reconnectionInterval;
if (reconnectionInterval > 0) { if (reconnectionInterval > 0) {
this.reconnectionHandler = scheduler.scheduleWithFixedDelay(() -> { this.reconnectionHandler = scheduler.scheduleWithFixedDelay(() -> {
if (connect() && reconnectionHandler != null) { final ScheduledFuture<?> currentReconnectionHandler = this.reconnectionHandler;
reconnectionHandler.cancel(false); if (connect() && currentReconnectionHandler != null) {
currentReconnectionHandler.cancel(false);
} }
}, reconnectionInterval, reconnectionInterval, TimeUnit.SECONDS); }, reconnectionInterval, reconnectionInterval, TimeUnit.SECONDS);
} }

View File

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

View File

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