51 lines
1.5 KiB
Java
51 lines
1.5 KiB
Java
package com.ruoyi.iot.domain;
|
||
|
||
import com.ruoyi.ss.device.domain.enums.DeviceOutageWay;
|
||
import lombok.Data;
|
||
import org.springframework.format.annotation.DateTimeFormat;
|
||
|
||
import java.math.BigDecimal;
|
||
import java.util.Date;
|
||
|
||
/**
|
||
* 设备传来的数据
|
||
* @author wjh
|
||
* 2024/3/20
|
||
*/
|
||
@Data
|
||
public class IotDeviceInfo {
|
||
private String mac;
|
||
|
||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||
private Date at; // 时间
|
||
|
||
private BigDecimal v; // 电压
|
||
private BigDecimal p; // 功率(瓦)
|
||
private BigDecimal a; // 电流
|
||
private BigDecimal w; // 总用电量(度)
|
||
private String s; // 开关状态,0不通电,1闭合通电
|
||
private BigDecimal m; // 剩余电量(度)
|
||
private String set; // 开关设置状态
|
||
private BigDecimal time; // 剩余时间(秒)
|
||
private String model; // 型号
|
||
private String wifi; // WIFI
|
||
private String version; // 版本号
|
||
private BigDecimal vxs; // 电压系数
|
||
|
||
public static IotDeviceInfo newDefaultInstance() {
|
||
IotDeviceInfo info = new IotDeviceInfo();
|
||
info.setV(BigDecimal.ZERO);
|
||
info.setP(BigDecimal.ZERO);
|
||
info.setA(BigDecimal.ZERO);
|
||
info.setW(BigDecimal.ZERO);
|
||
info.setS("0");
|
||
info.setM(BigDecimal.ZERO);
|
||
info.setSet(DeviceOutageWay.IMMEDIATE.getValue());
|
||
info.setTime(BigDecimal.ZERO);
|
||
info.setModel(null);
|
||
info.setVersion(null);
|
||
info.setVxs(BigDecimal.ONE);
|
||
return info;
|
||
}
|
||
}
|