device.js 918 B

123456789101112131415161718192021
  1. const {request} = require('../https/request.js')
  2. module.exports = {
  3. //添加设备
  4. postDevice: (params) => request('/devices', 'POST', params),
  5. //获取设备信息
  6. getDevice: (Device,Group) => request('/devices?id=' + Device + '&group_id='+ Group, 'GET'),
  7. //修改设备
  8. putDevice: (params) => request('/devices', 'PUT', params),
  9. //删除设备
  10. delDevice: (Device) => request('/devices?id=' + Device,'DELETE'),
  11. //获取回路参数
  12. getloop:(Device) => request('/devices/relays?device_id=' + Device,'GET'),
  13. //配置回路参数
  14. postloop:(params) => request('/devices/relays','POST',params),
  15. //控制回路开关
  16. loopSwitch:(params) => request('/devices/operation','POST',params),
  17. //获取回路的开关状态
  18. loopSwitchstate:(Device) => request('/devices/relays/status?device_id='+ Device,'GET'),
  19. //获取回路的光照度列表
  20. looplightlist:() => request('/illuminance','GET')
  21. }