devices.js 1.3 KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. var express_1 = __importDefault(require("express"));
  7. var devices_1 = require("../services/devices");
  8. var router = express_1.default.Router();
  9. router.get('/', devices_1.getDevices);
  10. router.get('/refresh', function (req, res, next) {
  11. req.body.refresh = true;
  12. next();
  13. }, devices_1.getDevices);
  14. router.get('/device', devices_1.getDeviceById);
  15. router.post('/device/upgrade', devices_1.upgradeDevice);
  16. router.post('/disabled', devices_1.disableDevice);
  17. router.post('/updateName', devices_1.updateDeviceName);
  18. router.post('/updateChannelName', devices_1.updateChannelName);
  19. router.post('/proxy2ws', devices_1.proxy2ws);
  20. router.post('/getOTAinfo', devices_1.getOTAinfo);
  21. router.post('/diy', devices_1.updateDiyDevice);
  22. router.delete('/diy', devices_1.removeDiyDevice);
  23. router.post('/device/unit', devices_1.changeUnit);
  24. router.post('/device/rate', devices_1.setRate);
  25. router.post('/device/tempHumHistory', devices_1.getDevTempHumHistory);
  26. router.post('/lan', devices_1.updateLanDevice);
  27. router.post('/electricRate', devices_1.updateElectricRate);
  28. exports.default = router;