[tivo] Fix thing staying offline after connection refresh (#10902)

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
mlobstein 2021-07-06 12:46:25 -05:00 committed by GitHub
parent fd577a78b0
commit 58f20c5028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -115,6 +115,7 @@ public class TiVoHandler extends BaseThingHandler {
}
public void setStatusOffline() {
lastConnectionStatus = ConnectionStatus.UNKNOWN;
this.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Power on device or check network configuration/connection.");
}

View File

@ -20,6 +20,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.concurrent.TimeUnit;
@ -441,7 +442,7 @@ public class TivoStatusProvider {
try {
receivedData = reader.readLine();
} catch (SocketTimeoutException e) {
} catch (SocketTimeoutException | SocketException e) {
// Do nothing. Just allow the thread to check if it has to stop.
}