本文整理汇总了Java中org.eclipse.smarthome.config.discovery.AbstractDiscoveryService类的典型用法代码示例。如果您正苦于以下问题:Java AbstractDiscoveryService类的具体用法?Java AbstractDiscoveryService怎么用?Java AbstractDiscoveryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractDiscoveryService类属于org.eclipse.smarthome.config.discovery包,在下文中一共展示了AbstractDiscoveryService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startBackgroundDiscovery
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; //导入依赖的package包/类
/**
* Starts background scanning for attached devices.
*/
@Override
protected void startBackgroundDiscovery() {
if (scanningJob == null || scanningJob.isCancelled()) {
logger.debug("start background scanning job at intervall {}s", SCAN_INTERVAL);
scanningJob = AbstractDiscoveryService.scheduler.scheduleWithFixedDelay(() -> {
if (bridgeHandler.getWebInterface() != null) {
logger.debug("start background scan on bridge {}", bridgeHandler.getThing().getUID());
FritzAhaDiscoveryCallback callback = new FritzAhaDiscoveryCallback(bridgeHandler.getWebInterface(),
this);
bridgeHandler.getWebInterface().asyncGet(callback);
}
}, INITIAL_DELAY, SCAN_INTERVAL, TimeUnit.SECONDS);
} else {
logger.debug("scanningJob active");
}
}
示例2: startBackgroundDiscovery
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; //导入依赖的package包/类
@Override
protected void startBackgroundDiscovery() {
logger.trace("Start HEOS Player background discovery");
if (scanningJob == null || scanningJob.isCancelled()) {
this.scanningJob = AbstractDiscoveryService.scheduler.scheduleWithFixedDelay(this.scanningRunnable,
INITIAL_DELAY, SCAN_INTERVAL, TimeUnit.SECONDS);
}
logger.trace("scanningJob active");
// Debug
// System.out.println("start background discover");
}
示例3: activate
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; //导入依赖的package包/类
@Override
protected void activate(Map<String, Object> configProperties) {
logger.debug("Config Parameters: {}", configProperties);
Util.init(AbstractDiscoveryService.scheduler);
discoveryManager = DiscoveryManager.getInstance();
discoveryManager.setPairingLevel(DiscoveryManager.PairingLevel.ON);
discoveryManager.addListener(this);
super.activate(configProperties); // starts background discovery
}
示例4: startBackgroundDiscovery
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; //导入依赖的package包/类
@Override
protected void startBackgroundDiscovery() {
if (mZWayDeviceScanningJob == null || mZWayDeviceScanningJob.isCancelled()) {
logger.debug("Starting background scanning job");
mZWayDeviceScanningJob = AbstractDiscoveryService.scheduler.scheduleWithFixedDelay(
mZWayDeviceScanningRunnable, INITIAL_DELAY, SCAN_INTERVAL, TimeUnit.SECONDS);
} else {
logger.debug("Scanning job is allready active");
}
}