Michael,
I’m a little disappoint about this issue.
I’ve said you it was not working, but after making quite lot of test, as it was not working at first place, it restart working on my openhab 5.1 snapshot without modifying anything. I’ve just start / stop the Sonos thing several time.
I’m asking myself if it’s not related to something that I observe on my dev platform a few weeks ago, but have not commit the modifications.
@Nadahar : I would appreciate your advice on this.
I’ve notice something nasty occurred in the Sonos binding, but I can explain why.
In the current code of initialize in ZonePlayer:
@Override
public void initialize() {
logger.debug("initializing handler for thing {}", getThing().getUID());
if (migrateThingType()) {
// we change the type, so we might need a different handler -> let's finish
return;
}
configuration = getConfigAs(ZonePlayerConfiguration.class);
String udn = configuration.udn;
if (udn != null && !udn.isEmpty()) {
service.registerParticipant(this);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, configuration.refresh, TimeUnit.SECONDS);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.conf-error-missing-udn");
logger.debug("Cannot initalize the zoneplayer. UDN not set.");
}
}
We are pooling a job with 0 delay, that should start the this::poll immediately.
But I’ve noticed that this::poll is not start every time, and so that the binding stay time to time uninitialized until th refresh delay occured.
This does not seems to occurs if we put a bigger value to initialDelay (1 or 2 seconds).
This can be a problems as gena subscription are setup in the poll function, and so nothing is working until the first refresh.
I’m not sure also if we have not an issue at all about start of jupnp stuff.
When I’ve got the problem this afternoon, It seems that I’ve not received upnp event at alls.
I’ve put a breakpoint on ReceivingEvent:executeSync function, but didn’t eat the breakpoints at all, even for traditional Upnp devices. I was not able to trace it deeper as for some reason, after some openhab start/stop, it restart to work correctly.
Laurent.