THING_TYPE_VELUX_ACTUATOR, THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW,
THING_TYPE_VELUX_VSHUTTER, THING_TYPE_BINDING, THING_TYPE_BRIDGE);
+ public static final Set<ThingTypeUID> ACTUATOR_THINGS = Set.of(THING_TYPE_VELUX_ACTUATOR,
+ THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW);
+
// *** List of all Channel ids ***
// List of all binding channel ids
public static final String UNKNOWN_THING_TYPE_ID = "FAILED";
public static final String UNKNOWN_IP_ADDRESS = "xxx.xxx.xxx.xxx";
-
- public static final String BRIDGE_THING_TYPE_UID = THING_TYPE_BRIDGE.toString();
}
@Override
protected void startBackgroundDiscovery() {
logger.trace("startBackgroundDiscovery() called.");
- if (backgroundTask == null || backgroundTask.isCancelled()) {
+ ScheduledFuture<?> task = this.backgroundTask;
+ if (task == null || task.isCancelled()) {
this.backgroundTask = scheduler.scheduleWithFixedDelay(this::startScan, 10, 600, TimeUnit.SECONDS);
}
}
LOGGER.trace("handleCommand(): ignoring non SCENE_ACTION.");
continue;
}
- if (!ThingConfiguration.exists(thisBridgeHandler, channelUID,
+ if (!ThingConfiguration.exists(thisBridgeHandler, thisChannelUID,
VeluxBindingProperties.PROPERTY_SCENE_NAME)) {
LOGGER.trace("handleCommand(): aborting processing as scene name is not set.");
break;
* @param channelUID for type {@link ChannelUID}.
* @return thingTypeUID of type {@link ThingTypeUID}.
*/
- ThingTypeUID thingTypeUIDOf(ChannelUID channelUID) {
+ public ThingTypeUID thingTypeUIDOf(ChannelUID channelUID) {
String[] segments = channelUID.getAsString().split(AbstractUID.SEPARATOR);
if (segments.length > 1) {
return new ThingTypeUID(segments[0], segments[1]);
// Private
private void mapThing2Velux() {
- if (channelUID.toString().startsWith(VeluxBindingConstants.BRIDGE_THING_TYPE_UID)) {
- logger.trace("mapThing2Velux(): channel {} is on a Bridge Thing, exiting.", channelUID);
+ // only process real actuator things
+ if (!VeluxBindingConstants.ACTUATOR_THINGS.contains(bridgeHandler.thingTypeUIDOf(channelUID))) {
+ logger.trace("mapThing2Velux(): channel {} is not an Actuator Thing, exiting.", channelUID);
return;
}