[homekit] Allow Long type in configuration for numbers (#13509)

I.e. if it's set from a Ruby script

Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
Cody Cutrer
2022-10-09 01:04:06 -06:00
committed by GitHub
parent 3aac15df62
commit ccc199f429

View File

@@ -295,6 +295,12 @@ public class HomekitTaggedItem {
if ((value instanceof Double) && (defaultValue instanceof BigDecimal)) {
return (T) BigDecimal.valueOf(((Double) value).doubleValue());
}
if ((value instanceof Long) && (defaultValue instanceof Double)) {
return (T) Double.valueOf((Long) value);
}
if ((value instanceof Long) && (defaultValue instanceof BigDecimal)) {
return (T) BigDecimal.valueOf((Long) value);
}
}
}