fix: Import aiohttp.web submodule directly

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
2025-07-31 18:29:18 -06:00
parent e41ca46d1d
commit ed62e260a7

View File

@@ -1,5 +1,6 @@
import asyncio
import aiohttp
from aiohttp import web
import logging
import os
import io
@@ -86,7 +87,7 @@ async def monitor_garage_door(app):
# --- Web Server ---
async def handle_root(request):
"""Handler for the root GET request."""
return aiohttp.web.Response(text="hello world")
return web.Response(text="hello world")
async def on_startup(app):
"""Actions to perform on application startup."""
@@ -120,11 +121,11 @@ async def on_cleanup(app):
logging.info("Cleanup complete.")
def main():
app = aiohttp.web.Application()
app = web.Application()
app.router.add_get('/', handle_root)
app.on_startup.append(on_startup)
app.on_cleanup.append(on_cleanup)
aiohttp.web.run_app(app)
web.run_app(app)
if __name__ == '__main__':
if not os.path.exists(MODEL_PATH):