Signed-off-by: Carlos Primo <tristinero@gmail.com>
Signed-off-by: carlospg79 <tristinero@gmail.com>
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);
}
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()) {