add basic OTA support for single server deployment

Committer: rxchen <rchentl@hotmail.com>
This commit is contained in:
rui chen
2025-12-17 16:26:35 +08:00
parent 109d924591
commit 33a385cfa8
2 changed files with 209 additions and 15 deletions
+4 -1
View File
@@ -48,6 +48,9 @@ class SimpleHttpServer:
web.get("/xiaozhi/ota/", self.ota_handler.handle_get),
web.post("/xiaozhi/ota/", self.ota_handler.handle_post),
web.options("/xiaozhi/ota/", self.ota_handler.handle_post),
# 下载接口,仅提供 data/bin/*.bin 下载
web.get("/xiaozhi/ota/download/{filename}", self.ota_handler.handle_download),
web.options("/xiaozhi/ota/download/{filename}", self.ota_handler.handle_download),
]
)
# 添加路由
@@ -67,4 +70,4 @@ class SimpleHttpServer:
# 保持服务运行
while True:
await asyncio.sleep(3600) # 每隔 1 小时检查一次
await asyncio.sleep(3600) # 每隔 1 小时检查一次