mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Fix forgotten check for dict
This commit is contained in:
@@ -67,7 +67,9 @@ def patch_restore_sensor() -> Generator[None]:
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
"""Return a dict representation of the sensor data."""
|
||||
data = real_as_dict(self)
|
||||
if not (_type := data["native_value"].get("__type")):
|
||||
if not isinstance(data["native_value"], dict) or not (
|
||||
_type := data["native_value"].get("__type")
|
||||
):
|
||||
return data
|
||||
if _type == "<class 'freezegun.api.FakeDate'>":
|
||||
data["native_value"]["__type"] = "<class 'datetime.date'>"
|
||||
|
||||
Reference in New Issue
Block a user