[velux] Do not use new API on Somfy devices (#14225)
* [velux] revert use of new API for Somfy devices * [velux] fix compare to wrong value Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
parent
01c38df9a5
commit
178d16c4a0
|
@ -95,10 +95,18 @@ final class ChannelActuatorPosition extends ChannelHandlerTemplate {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final VeluxExistingProducts existingProducts = thisBridgeHandler.existingProducts();
|
||||||
|
|
||||||
GetProduct bcp = null;
|
GetProduct bcp = null;
|
||||||
switch (channelId) {
|
switch (channelId) {
|
||||||
case CHANNEL_ACTUATOR_POSITION:
|
case CHANNEL_ACTUATOR_POSITION:
|
||||||
case CHANNEL_ACTUATOR_STATE:
|
case CHANNEL_ACTUATOR_STATE:
|
||||||
|
// apparently Somfy products do not to support new API; so use older API instead
|
||||||
|
if (existingProducts.get(veluxActuator.getProductBridgeIndex()).isSomfyProduct()) {
|
||||||
|
bcp = thisBridgeHandler.thisBridge.bridgeAPI().getProduct();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// fall through
|
||||||
case CHANNEL_VANE_POSITION:
|
case CHANNEL_VANE_POSITION:
|
||||||
bcp = thisBridgeHandler.thisBridge.bridgeAPI().getProductStatus();
|
bcp = thisBridgeHandler.thisBridge.bridgeAPI().getProductStatus();
|
||||||
default:
|
default:
|
||||||
|
@ -118,7 +126,6 @@ final class ChannelActuatorPosition extends ChannelHandlerTemplate {
|
||||||
|
|
||||||
VeluxProduct newProduct = bcp.getProduct();
|
VeluxProduct newProduct = bcp.getProduct();
|
||||||
ProductBridgeIndex productBridgeIndex = newProduct.getBridgeProductIndex();
|
ProductBridgeIndex productBridgeIndex = newProduct.getBridgeProductIndex();
|
||||||
VeluxExistingProducts existingProducts = thisBridgeHandler.existingProducts();
|
|
||||||
VeluxProduct existingProduct = existingProducts.get(productBridgeIndex);
|
VeluxProduct existingProduct = existingProducts.get(productBridgeIndex);
|
||||||
ProductState productState = newProduct.getProductState();
|
ProductState productState = newProduct.getProductState();
|
||||||
switch (productState) {
|
switch (productState) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class VeluxProductPosition {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUnknownOrValid(int position) {
|
public static boolean isUnknownOrValid(int position) {
|
||||||
return (position == VeluxProductPosition.VPP_UNKNOWN) || isValid(position);
|
return (position == VeluxProductPosition.VPP_VELUX_UNKNOWN) || isValid(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue