Projet de remplacement du "RPiPasserelle" d'Otec.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. ])