fix: mockup topic
This commit is contained in:
@@ -10,14 +10,14 @@ export default abstract class CommandService {
|
|||||||
try {
|
try {
|
||||||
const topicData = `${body.merchantName}/${body.floorName}_${body.unitNumber}-${body.deviceName}-${body.roomName}-${body.deviceType}-${body.commandType}-${body.towerNumber}`
|
const topicData = `${body.merchantName}/${body.floorName}_${body.unitNumber}-${body.deviceName}-${body.roomName}-${body.deviceType}-${body.commandType}-${body.towerNumber}`
|
||||||
|
|
||||||
if (topicData == 'SAVY/01_L2-L-LV-S-C-T1' && ['On', 'Off'].includes(body.payload.action)) {
|
if (topicData == 'SAVY/L2_01-L-LV-S-C-T1' && ['On', 'Off'].includes(body.payload.action)) {
|
||||||
return {
|
return {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
message: 'Command accepted',
|
message: 'Command accepted',
|
||||||
receivedAt: new Date().toISOString(),
|
receivedAt: new Date().toISOString(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (topicData == 'SAVY/01_L2-BL-LV-S-C-T1' && ['Open', 'Close'].includes(body.payload.action)) {
|
if (topicData == 'SAVY/L2_01-BL-LV-S-C-T1' && ['Open', 'Close'].includes(body.payload.action)) {
|
||||||
return {
|
return {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
message: 'Command accepted',
|
message: 'Command accepted',
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export default abstract class QueryService {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deviceData = await queryDeviceStatus(topic)
|
const deviceData = await queryDeviceStatus(topic)
|
||||||
|
|
||||||
if (deviceData) {
|
if (deviceData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user