Skip to content

Commit

Permalink
fix: Update MeterReading with API changes (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyKh authored Nov 6, 2024
1 parent e1991a6 commit b014b1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iec_api/models/meter_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional

from mashumaro import DataClassDictMixin, field_options
from mashumaro.codecs import BasicDecoder
Expand Down Expand Up @@ -44,10 +45,10 @@ class MeterReading(DataClassDictMixin):
"""Meter Reading dataclass."""

reading: int = field(metadata=field_options(alias="reading"))
reading_code: str = field(metadata=field_options(alias="readingCode"))
reading_date: datetime = field(metadata=field_options(alias="readingDate"))
usage: str
serial_number: str = field(metadata=field_options(alias="serialNumber"))
reading_code: Optional[str] = field(default=None, metadata=field_options(alias="readingCode"))
usage: Optional[str] = field(default=None, metadata=field_options(alias="usage"))

@classmethod
def __post_deserialize__(cls, obj: "MeterReading") -> "MeterReading":
Expand Down

0 comments on commit b014b1e

Please sign in to comment.