fix: Python 3.10 compat for datetime.UTC in api_endpoints

datetime.UTC was added in Python 3.11. Fall back to timezone.utc on
older interpreters, matching the existing pattern in mqtt_handler.py.

Co-Authored-By: Zindello <josh@zindello.com.au>
This commit is contained in:
Zindello
2026-05-27 09:58:10 +10:00
parent 36aa8ecf0d
commit 7db6535a26
+7 -1
View File
@@ -2,7 +2,13 @@ import json
import logging
import os
import time
from datetime import UTC, datetime
from datetime import datetime
try:
from datetime import UTC
except ImportError:
from datetime import timezone
UTC = timezone.utc
from pathlib import Path
from typing import Callable, Optional