Skip to content

Commit

Permalink
[smartmeter] Fix flooding logs with warnings if serial port is not ac…
Browse files Browse the repository at this point in the history
…cesible (openhab#9781)

Fixes openhab#9780

Signed-off-by: Stefan Triller <github@stefantriller.de>
  • Loading branch information
t2000 authored and thinkingstone committed Nov 7, 2021
1 parent c972293 commit 4b60a7a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ public Disposable readValues(long timeout, ScheduledExecutorService executorServ
return Flowable.fromPublisher(connector.getMeterValues(initMessage, period, executorService))
.timeout(timeout + period.toMillis(), TimeUnit.MILLISECONDS, Schedulers.from(executorService))
.doOnSubscribe(sub -> {
logger.info("Opening connection to {}", getDeviceId());
logger.debug("Opening connection to {}", getDeviceId());
connector.openConnection();
}).doOnError(ex -> {
if (ex instanceof TimeoutException) {
logger.warn("Timeout occured for {}; {}", getDeviceId(), ex.getMessage());
logger.debug("Timeout occured for {}; {}", getDeviceId(), ex.getMessage());
} else {
logger.warn("Failed to read: {}. Closing connection and trying again in {} seconds...; {}",
logger.debug("Failed to read: {}. Closing connection and trying again in {} seconds...; {}",
ex.getMessage(), RETRY_DELAY, getDeviceId(), ex);
}
connector.closeConnection();
Expand Down

0 comments on commit 4b60a7a

Please sign in to comment.