зеркало из https://github.com/mozilla/smarthome.git
Also allow Double if the value is an integer number
JSON parses all integers to doubles, hence we have to deal with this situation as well. It probably makes sense to merge all this validation logic with the ConfigValidation code soon. Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Родитель
1a7473c662
Коммит
0f2a554dc6
|
@ -222,7 +222,8 @@ public class RuntimeRule extends Rule {
|
|||
case BOOLEAN:
|
||||
return configValue instanceof Boolean;
|
||||
case INTEGER:
|
||||
return configValue instanceof BigDecimal || configValue instanceof Integer;
|
||||
return configValue instanceof BigDecimal || configValue instanceof Integer
|
||||
|| configValue instanceof Double && ((Double) configValue).intValue() == (double) configValue;
|
||||
case DECIMAL:
|
||||
return configValue instanceof BigDecimal || configValue instanceof Double;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче