[remoteopenhab] Accept Decimal state for items of type Number with a dimension (#9151)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
a3835ebdc6
commit
7130886d22
@ -463,9 +463,13 @@ public class RemoteopenhabBridgeHandler extends BaseBridgeHandler
|
|||||||
}
|
}
|
||||||
} else if (acceptedItemType.startsWith(CoreItemFactory.NUMBER + ":")) {
|
} else if (acceptedItemType.startsWith(CoreItemFactory.NUMBER + ":")) {
|
||||||
// Item type Number with dimension
|
// Item type Number with dimension
|
||||||
if (checkStateType(itemName, stateType, "Quantity")) {
|
if (stateType == null || "Quantity".equals(stateType)) {
|
||||||
List<Class<? extends State>> stateTypes = Collections.singletonList(QuantityType.class);
|
List<Class<? extends State>> stateTypes = Collections.singletonList(QuantityType.class);
|
||||||
channelState = TypeParser.parseState(stateTypes, state);
|
channelState = TypeParser.parseState(stateTypes, state);
|
||||||
|
} else if ("Decimal".equals(stateType)) {
|
||||||
|
channelState = new DecimalType(state);
|
||||||
|
} else {
|
||||||
|
logger.debug("Unexpected value type {} for item {}", stateType, itemName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (acceptedItemType) {
|
switch (acceptedItemType) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user