[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

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);
}
}
}