mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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 + ":")) {
|
||||
// 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);
|
||||
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 {
|
||||
switch (acceptedItemType) {
|
||||
|
Loading…
Reference in New Issue
Block a user