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 680B

1234567891011121314151617181920212223
  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.variable_values import app as values
  9. async def index(request):
  10. with open('index.html') as html:
  11. return HTMLResponse(html.read())
  12. raise HTTPException(404)
  13. application = Router(routes=[
  14. Route('/', index),
  15. Mount('/config', config),
  16. Mount('/heatpump', heatpump),
  17. Mount('/variables', types),
  18. Mount('/values', values)
  19. ])