mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-02-05 03:44:15 +01:00
Signed-off-by: Carlos Primo <tristinero@gmail.com> Signed-off-by: carlospg79 <tristinero@gmail.com>
This commit is contained in:
parent
edec4c7cf5
commit
fcd6ed6e57
@ -170,6 +170,12 @@ public class LgTvSerialHandler extends BaseThingHandler {
|
|||||||
if (updateJob == null || updateJob.isCancelled()) {
|
if (updateJob == null || updateJob.isCancelled()) {
|
||||||
updateJob = scheduler.scheduleWithFixedDelay(eventRunnable, 0, EVENT_REFRESH_INTERVAL, TimeUnit.SECONDS);
|
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);
|
updateStatus(ThingStatus.ONLINE);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class LGSerialCommunicator {
|
|||||||
int data;
|
int data;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
while ((data = input.read()) > -1) {
|
while (input.available() > 0 && (data = input.read()) > -1) {
|
||||||
if (data == 'x') {
|
if (data == 'x') {
|
||||||
String result = new String(buffer, offset, len);
|
String result = new String(buffer, offset, len);
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user