Skip to content

Commit

Permalink
Print native string value instead Enum when using ExternalDevice.Devi…
Browse files Browse the repository at this point in the history
…ceType value (#478)
  • Loading branch information
DCSBL authored Jan 7, 2025
1 parent d478b7e commit d1b3937
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions homewizard_energy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from enum import StrEnum
from typing import Any

from mashumaro.config import BaseConfig
Expand Down Expand Up @@ -448,7 +448,7 @@ def __post_deserialize__(cls, obj: Measurement) -> Measurement:
class ExternalDevice(BaseModel):
"""Represents externally connected device."""

class DeviceType(Enum):
class DeviceType(StrEnum):
"""Device type allocations."""

GAS_METER = "gas_meter"
Expand Down
Loading

0 comments on commit d1b3937

Please sign in to comment.