Projet de remplacement du "RPiPasserelle" d'Otec.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

app.py 730B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. from starlette.routing import Router, Mount, Route
  3. from starlette.responses import HTMLResponse
  4. from starlette.exceptions import HTTPException
  5. from pyheatpump.config import app as config
  6. from pyheatpump.heatpump import app as heatpump
  7. from pyheatpump.variable_types import app as types
  8. from pyheatpump.variables import app as variables
  9. from pyheatpump.variable_values import app as values
  10. async def index(request):
  11. with open('index.html') as html:
  12. return HTMLResponse(html.read())
  13. raise HTTPException(404)
  14. application = Router(routes=[
  15. Route('/', index),
  16. Mount('/config', config),
  17. Mount('/heatpump', heatpump),
  18. Mount('/variables', types),
  19. Mount('/values', values)
  20. ])