deploy: change method to get status from device
This commit is contained in:
@@ -143,3 +143,38 @@ export function verify(data: unknown, signature: string, secretKey?: string): bo
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.table([
|
||||||
|
// { act: 'command', signature: sign(
|
||||||
|
// {
|
||||||
|
// merchantName: 'SAVY',
|
||||||
|
// floorName: 'L2',
|
||||||
|
// unitNumber: '01',
|
||||||
|
// deviceName: 'AC',
|
||||||
|
// roomName: 'LV',
|
||||||
|
// deviceType: 'S',
|
||||||
|
// commandType: 'C',
|
||||||
|
// towerNumber: 'T1',
|
||||||
|
// timestamp: '2025-10-21T04:00:10.673Z',
|
||||||
|
// nonce: '50ce476cd1c355ae552ae18be55af72c',
|
||||||
|
// payload: {
|
||||||
|
// action: 'AC=On',
|
||||||
|
// },
|
||||||
|
// }, 'e3faa00e170884b3adc6c37253ec97e9') },
|
||||||
|
// {
|
||||||
|
// act: 'state',
|
||||||
|
// signature: sign({
|
||||||
|
// merchantName: 'SAVY',
|
||||||
|
// floorName: 'L2',
|
||||||
|
// unitNumber: '01',
|
||||||
|
// deviceName: 'AC',
|
||||||
|
// roomName: 'LV',
|
||||||
|
// deviceType: 'S',
|
||||||
|
// commandType: 'S',
|
||||||
|
// towerNumber: 'T1',
|
||||||
|
// timestamp: '2025-10-21T04:00:10.673Z',
|
||||||
|
// nonce: '50ce476cd1c355ae552ae18be55af72c',
|
||||||
|
// }, 'e3faa00e170884b3adc6c37253ec97e9'),
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// ['act', 'signature'])
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ export const deviceCommandBody = z.object({
|
|||||||
timestamp: z.string().datetime(), // ISO8601
|
timestamp: z.string().datetime(), // ISO8601
|
||||||
nonce: z.string(),
|
nonce: z.string(),
|
||||||
payload: z.object({
|
payload: z.object({
|
||||||
action: z.enum(['on', 'off', 'set']),
|
action: z.string(),
|
||||||
temp: z.number().optional(),
|
|
||||||
}),
|
}),
|
||||||
signature: z.string(),
|
signature: z.string(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type OpenApiDocumentation = Omit<Partial<OpenAPIV3.Document<OpenApiDocWithTagGro
|
|||||||
|
|
||||||
export const swaggerPlugin = openapi({
|
export const swaggerPlugin = openapi({
|
||||||
path: '/swagger',
|
path: '/swagger',
|
||||||
provider: 'swagger-ui',
|
provider: 'scalar',
|
||||||
mapJsonSchema: {
|
mapJsonSchema: {
|
||||||
zod: z.toJSONSchema,
|
zod: z.toJSONSchema,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user