Fixes #8646 - Bugfix for openHAB > 3.1.x (#11776)

Signed-off-by: Carlos Primo <tristinero@gmail.com>
Signed-off-by: carlospg79 <tristinero@gmail.com>
This commit is contained in:
carlospg79 2021-12-17 07:57:23 +01:00 committed by GitHub
parent edec4c7cf5
commit fcd6ed6e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -170,6 +170,12 @@ public class LgTvSerialHandler extends BaseThingHandler {
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);
}

View File

@ -79,7 +79,7 @@ public class LGSerialCommunicator {
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()) {