diff --git a/wsme/types.py b/wsme/types.py index 95bee91..7d0357d 100644 --- a/wsme/types.py +++ b/wsme/types.py @@ -218,7 +218,9 @@ def validate_value(datatype, value): value = value.decode() elif datatype is bytes and isinstance(value, text): value = value.encode() - elif datatype is float and not isinstance(value, float): + elif datatype is float and (isinstance(value, int) + or isinstance(value, text) + or isinstance(value, bytes)): value = float(value) elif not isinstance(value, datatype): raise ValueError(