[yioremote] Bug fix during websocket error by disposing pollingjob (#9350)

* Bug fix during websocket error by disposing pollingjob

Signed-off-by: Michael Loercher<michaelloercher@web.de>
This commit is contained in:
miloit 2020-12-13 13:52:40 +01:00 committed by GitHub
parent 9d054f2447
commit ac074ea1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -139,14 +139,17 @@ public class YIOremoteDockHandler extends BaseThingHandler {
@Override
public void onClose() {
disposeWebsocketPollingJob();
reconnectWebsocket();
}
@Override
public void onError(Throwable cause) {
disposeWebsocketPollingJob();
yioRemoteDockActualStatus = YioRemoteDockHandleStatus.COMMUNICATION_ERROR;
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Communication lost no ping from YIO DOCK");
reconnectWebsocket();
}
});