diff --git a/matter_server/common/models.py b/matter_server/common/models.py index 4c291840..c7128eb0 100644 --- a/matter_server/common/models.py +++ b/matter_server/common/models.py @@ -266,5 +266,5 @@ def as_dict(self) -> dict: "min_applicable_software_version": self.min_applicable_software_version, "max_applicable_software_version": self.max_applicable_software_version, "release_notes_url": self.release_notes_url, - "update_source": str(self.update_source), + "update_source": self.update_source.value, } diff --git a/matter_server/server/ota/provider.py b/matter_server/server/ota/provider.py index cb583552..513af57c 100644 --- a/matter_server/server/ota/provider.py +++ b/matter_server/server/ota/provider.py @@ -5,7 +5,6 @@ import asyncio from base64 import b64encode from datetime import UTC, datetime -import functools import hashlib import logging from pathlib import Path @@ -78,11 +77,8 @@ def __init__(self, vendor_id: int, ota_provider_dir: Path) -> None: async def initialize(self) -> None: """Initialize OTA Provider.""" - - loop = asyncio.get_event_loop() - - await loop.run_in_executor( - None, functools.partial(self._ota_provider_dir.mkdir, exist_ok=True) + await asyncio.to_thread( + self._ota_provider_dir.mkdir, exist_ok=True, parents=True ) async def _commission_ota_provider(