Skip to content

Commit

Permalink
Fix ExternalDeviceType not deserialized correcly
Browse files Browse the repository at this point in the history
  • Loading branch information
DCSBL committed Jan 7, 2025
1 parent 1e7fc27 commit e706316
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions homewizard_energy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ class DeviceType(Enum):
type: DeviceType | None = field(
default=None,
metadata={
"deserialize": lambda x: ExternalDevice.DeviceType(x)
if x in ExternalDevice.DeviceType.__members__.values()
else None
"deserialize": lambda x: ExternalDevice.DeviceType.__members__.get(
x.upper(), None
)
},
)
value: float = field()
Expand Down
Loading

0 comments on commit e706316

Please sign in to comment.