fix: mockup topic

This commit is contained in:
2025-12-08 12:46:00 +07:00
parent 02457a6f61
commit ae64008f9a
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -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',
-1
View File
@@ -53,7 +53,6 @@ export default abstract class QueryService {
}, },
} }
} }
const deviceData = await queryDeviceStatus(topic) const deviceData = await queryDeviceStatus(topic)
if (deviceData) { if (deviceData) {