mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Enable serialization of float subclasses with orjson (#74136)
This commit is contained in:
@ -35,6 +35,8 @@ def json_encoder_default(obj: Any) -> Any:
|
||||
"""
|
||||
if isinstance(obj, set):
|
||||
return list(obj)
|
||||
if isinstance(obj, float):
|
||||
return float(obj)
|
||||
if hasattr(obj, "as_dict"):
|
||||
return obj.as_dict()
|
||||
if isinstance(obj, Path):
|
||||
|
Reference in New Issue
Block a user