Skip to content

Commit

Permalink
fix: timezone for non-3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L committed Sep 9, 2023
1 parent d296a90 commit 4ab6dce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roborock/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any, NamedTuple

from datetime import timezone
from dacite import Config, from_dict

from .code_mappings import (
Expand Down Expand Up @@ -427,9 +427,9 @@ class CleanRecord(RoborockBase):
def __post_init__(self) -> None:
self.square_meter_area = round(self.area / 1000000, 1) if self.area is not None else None
self.begin_datetime = (
datetime.datetime.fromtimestamp(self.begin).astimezone(datetime.UTC) if self.begin else None
datetime.datetime.fromtimestamp(self.begin).astimezone(timezone.utc) if self.begin else None
)
self.end_datetime = datetime.datetime.fromtimestamp(self.end).astimezone(datetime.UTC) if self.end else None
self.end_datetime = datetime.datetime.fromtimestamp(self.end).astimezone(timezone.utc) if self.end else None


@dataclass
Expand Down

0 comments on commit 4ab6dce

Please sign in to comment.