import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
  let param = '?page=' + data.page + '&size=' + data.size;
  if (data.ldDeviceSerial != '' && data.ldDeviceSerial != undefined) {
    param += '&ldDeviceSerial=' + data.ldDeviceSerial;
  }
  if (data.tuyaDeviceId != '' && data.tuyaDeviceId != undefined) {
    param += '&tuyaDeviceId=' + data.tuyaDeviceId;
  }
  return request({
    url: '/tuya/devices/list' + param,
    method: 'get',
    data,
  });
}
//注册设备
export function register(data) {
  return request({
    url: '/tuya/devices/register',
    method: 'post',
    data,
  });
}
//删除设备
export function deleteDevice(tuyaDeviceId) {
  return request({
    url: '/tuya/devices/delete/' + tuyaDeviceId,
    method: 'post',
  });
}
