Skip to content

Commit

Permalink
[velux] Avoiding warning about (yet) unrecognized actuators esp. duri…
Browse files Browse the repository at this point in the history
…ng startup phase. (openhab#7379)

Signed-off-by: Guenther Schreiner <[email protected]>
  • Loading branch information
gs4711 authored and J-N-K committed Jul 14, 2020
1 parent 250e570 commit d1daed4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ private void syncChannelsWithProducts() {
logger.trace("syncChannelsWithProducts(): channel {} not found.", channelUID);
continue;
}
if (!channel2VeluxActuator.get(channelUID).isKnown()) {
logger.trace("syncChannelsWithProducts(): channel {} not registered on bridge.", channelUID);
continue;
}
ProductBridgeIndex channelPbi = channel2VeluxActuator.get(channelUID).getProductBridgeIndex();
if (!channelPbi.equals(productPbi)) {
continue;
Expand All @@ -471,6 +475,7 @@ private void syncChannelsWithProducts() {
logger.trace("syncChannelsWithProducts(): resetting dirty flag.");
bridgeParameters.actuators.getChannel().existingProducts.resetDirtyFlag();
logger.trace("syncChannelsWithProducts() done.");

}

// Processing of openHAB events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* the methods provide a cache for faster access,
* <ul>
* <li>{@link #Thing2VeluxActuator} Constructor,</LI>
* <li>{@link #isKnown} returns whether actuator is well-known,</LI>
* <li>{@link #getProductBridgeIndex} returns the Velux bridge index for access,</LI>
* <li>{@link #isInverted} returns a flag about value inversion.</LI>
* </UL>
Expand All @@ -51,8 +52,8 @@ public class Thing2VeluxActuator {
private void mapThing2Velux() {
if (!ThingConfiguration.exists(bridgeHandler, channelUID,
VeluxBindingProperties.CONFIG_ACTUATOR_SERIALNUMBER)) {
logger.warn("mapThing2Velux(): aborting processing as {} is not set.",
VeluxBindingProperties.CONFIG_ACTUATOR_SERIALNUMBER);
logger.trace("mapThing2Velux(): aborting processing as {} is not set within {}.",
VeluxBindingProperties.CONFIG_ACTUATOR_SERIALNUMBER, channelUID);
return;
}
String actuatorSerial = (String) ThingConfiguration.getValue(bridgeHandler, channelUID,
Expand Down Expand Up @@ -113,6 +114,16 @@ public ProductBridgeIndex getProductBridgeIndex() {
return thisProduct.getBridgeProductIndex();
}

/**
* Returns true, if the actuator is known within the bridge.
* <p>
*
* @return <b>isKnown</B> as boolean.
*/
public boolean isKnown() {
return (!(this.getProductBridgeIndex() == ProductBridgeIndex.UNKNOWN));
}

/**
* Returns the flag whether a value inversion in intended for the Velux device based on the Thing configuration
* which belongs to the channel passed during constructor.
Expand Down

0 comments on commit d1daed4

Please sign in to comment.