mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Fixed #9764 Signed-off-by: morph166955 <rosenblumb@gmail.com>
This commit is contained in:
parent
5dd30ea35f
commit
c77d3b93f2
@ -239,14 +239,26 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
private void checkAndCreateServices() {
|
||||
logger.debug("Check and create missing UPnP services");
|
||||
|
||||
boolean isOnline = false;
|
||||
|
||||
for (Device<?, ?, ?> device : upnpService.getRegistry().getDevices()) {
|
||||
createService((RemoteDevice) device);
|
||||
if (createService((RemoteDevice) device) == true) {
|
||||
isOnline = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isOnline == true) {
|
||||
logger.debug("Device was online");
|
||||
putOnline();
|
||||
} else {
|
||||
logger.debug("Device was NOT online");
|
||||
putOffline();
|
||||
}
|
||||
|
||||
checkCreateManualConnection();
|
||||
}
|
||||
|
||||
private synchronized void createService(RemoteDevice device) {
|
||||
private synchronized boolean createService(RemoteDevice device) {
|
||||
if (configuration.hostName != null
|
||||
&& configuration.hostName.equals(device.getIdentity().getDescriptorURL().getHost())) {
|
||||
String modelName = device.getDetails().getModelDetails().getModelName();
|
||||
@ -275,8 +287,9 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
||||
logger.debug("Service rediscovered, clearing caches: {}, {} ({})", modelName, type, udn);
|
||||
existingService.clearCache();
|
||||
}
|
||||
putOnline();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private @Nullable SamsungTvService findServiceInstance(String serviceName) {
|
||||
|
Loading…
Reference in New Issue
Block a user