mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix file size last_updated (#70114)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
9525077574
commit
23446fa1c0
@ -137,9 +137,10 @@ class FileSizeCoordinator(DataUpdateCoordinator):
|
||||
raise UpdateFailed(f"Can not retrieve file statistics {error}") from error
|
||||
|
||||
size = statinfo.st_size
|
||||
last_updated = datetime.fromtimestamp(statinfo.st_mtime).replace(
|
||||
last_updated = datetime.utcfromtimestamp(statinfo.st_mtime).replace(
|
||||
tzinfo=dt_util.UTC
|
||||
)
|
||||
|
||||
_LOGGER.debug("size %s, last updated %s", size, last_updated)
|
||||
data: dict[str, int | float | datetime] = {
|
||||
"file": round(size / 1e6, 2),
|
||||
|
Loading…
x
Reference in New Issue
Block a user