|
@@ -8,6 +8,7 @@ import (
|
|
|
"Cold_mqtt/models/Device"
|
|
|
"Cold_mqtt/models/Warning"
|
|
|
"encoding/json"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
@@ -190,7 +191,7 @@ func MessageDisconnected(topicName string, message []byte) {
|
|
|
DeviceSensorList := Device.Read_DeviceSensor_ByTsn(r_Device.T_sn)
|
|
|
logs.Println("DeviceSensorList:", DeviceSensorList)
|
|
|
for _, v := range DeviceSensorList {
|
|
|
- DeviceData_t, is := Device.RedisDeviceData_Get(r_Device.T_sn+"_Redis", v.T_id)
|
|
|
+ DeviceData_t, is := Device.RedisDeviceData_Get(r_Device.T_sn+"_Redis|"+strconv.Itoa(v.T_id), v.T_id)
|
|
|
logs.Println("DeviceData_t is:", is)
|
|
|
if is {
|
|
|
Device.Add_DeviceData(r_Device.T_sn, v.T_id, DeviceData_t, true)
|