Projet de remplacement du "RPiPasserelle" d'Otec.
Ви не можете вибрати більше 25 тем Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. from modbus.client.serial import rtu
  3. from starlette.routing import Router
  4. from starlette.responses import JSONResponse
  5. from conf import config
  6. from db.db import sql
  7. from pyheatpump.models import *
  8. def get_variable_values(request):
  9. res = {}
  10. for var_type_id, var_type in VariableType.getall():
  11. res[var_type_id] = {}
  12. for address, value in var_type.get_variables_values():
  13. res[address] = value
  14. return JSONResponse(res)
  15. heatpump = [
  16. Route('/', get_all_variable_values, methods=['GET'])
  17. ]