Skip to content

Commit

Permalink
Fixes openhab#8646 - Bugfix for openHAB > 3.1.x (openhab#11776)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Primo <[email protected]>
Signed-off-by: carlospg79 <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
  • Loading branch information
carlospg79 authored and andrasU committed Nov 12, 2022
1 parent 62661fd commit 4064c6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ public void onFailure(ChannelUID channel, LGSerialResponse response) {
if (updateJob == null || updateJob.isCancelled()) {
updateJob = scheduler.scheduleWithFixedDelay(eventRunnable, 0, EVENT_REFRESH_INTERVAL, TimeUnit.SECONDS);
}
// trigger REFRESH commands for all linked Channels to start polling
getThing().getChannels().forEach(channel -> {
if (isLinked(channel.getUID())) {
channelLinked(channel.getUID());
}
});

updateStatus(ThingStatus.ONLINE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public synchronized void write(LGSerialCommand command, String rawCommand, Chann
int data;
int len = 0;
int offset = 0;
while ((data = input.read()) > -1) {
while (input.available() > 0 && (data = input.read()) > -1) {
if (data == 'x') {
String result = new String(buffer, offset, len);
if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit 4064c6c

Please sign in to comment.