From b014b1ede714ba1f962a2d02b3623cd8af944a84 Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:30:28 +0200 Subject: [PATCH] fix: Update MeterReading with API changes (#153) --- iec_api/models/meter_reading.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iec_api/models/meter_reading.py b/iec_api/models/meter_reading.py index ac5a8e9..abc4615 100644 --- a/iec_api/models/meter_reading.py +++ b/iec_api/models/meter_reading.py @@ -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 @@ -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":