securitas-direct-new-api icon indicating copy to clipboard operation
securitas-direct-new-api copied to clipboard

añadir cerradura electrónica

Open hlas opened this issue 1 month ago • 1 comments

Hola

¿Sería posible añadir la apertura y cierre de la nueva cerradura eléctronica de SD? He capturado las llamadas a la API:

{ "operationName": "xSGetSmartlockConfig", "variables": { "numinst": "XXXXXXX", "panel": "SDVECUW", "devices": [ { "deviceType": "DR", "deviceId": "01", "keytype": "0" } ] }, "query": "query xSGetSmartlockConfig($numinst: String!, $panel: String!, $devices: [SmartlockDevicesInfo]!) {\n xSGetSmartlockConfig(numinst: $numinst, panel: $panel, devices: $devices) {\n res\n referenceId\n zoneId\n serialNumber\n location\n family\n type\n label\n features {\n holdBackLatchTime\n calibrationType\n autolock {\n active\n timeout\n }\n }\n }\n}" }

Respuesta: { "data": { "xSGetSmartlockConfig": [ { "res": "OK", "referenceId": null, "zoneId": "DR01", "serialNumber": "XXXXXXX", "location": "Pl_1_Recibidor", "family": "User", "type": "163", "label": "Cerradura", "features": { "holdBackLatchTime": 3, "calibrationType": 0, "autolock": { "active": true, "timeout": "1800" } } } ] } }

Apertura:

{ "operationName": "xSChangeSmartlockMode", "variables": { "numinst": "XXXXXXX", "panel": "SDVECUW", "deviceId": "01", "deviceType": "DR", "lock": false }, "query": "mutation xSChangeSmartlockMode($numinst: String!, $panel: String!, $deviceId: String!, $deviceType: String!, $lock: Boolean!) {\n xSChangeSmartlockMode(\n numinst: $numinst\n panel: $panel\n deviceId: $deviceId\n deviceType: $deviceType\n lock: $lock\n ) {\n res\n msg\n referenceId\n }\n}" }

Respuesta:

{ "data": { "xSChangeSmartlockMode": { "res": "OK", "msg": "Your request has been sent", "referenceId": "OWP______________XXXXXX__XXXXXXXX________________" } } }

{ "operationName": "xSChangeSmartlockModeStatus", "variables": { "numinst": "xxxxxxx", "panel": "SDVECUW", "deviceId": "01", "referenceId": "OWP_______________xxxxx_xxxxxxx_______________", "counter": 1 }, "query": "query xSChangeSmartlockModeStatus($numinst: String!, $panel: String!, $referenceId: String!, $deviceId: String, $counter: Int) {\n xSChangeSmartlockModeStatus(\n numinst: $numinst\n panel: $panel\n referenceId: $referenceId\n counter: $counter\n deviceId: $deviceId\n ) {\n res\n msg\n protomResponse\n status\n }\n}" }

{ "data": { "xSChangeSmartlockModeStatus": { "res": "WAIT", "msg": "Request in progress, please wait", "protomResponse": null, "status": null } } }

Y al final:

{ "data": { "xSChangeSmartlockModeStatus": { "res": "OK", "msg": "Request processed correctly", "protomResponse": null, "status": "procesed" } } }

Y para el cierre:

{ "operationName": "xSChangeSmartlockMode", "variables": { "numinst": "xxxxxxx", "panel": "SDVECUW", "deviceId": "01", "deviceType": "DR", "lock": true }, "query": "mutation xSChangeSmartlockMode($numinst: String!, $panel: String!, $deviceId: String!, $deviceType: String!, $lock: Boolean!) {\n xSChangeSmartlockMode(\n numinst: $numinst\n panel: $panel\n deviceId: $deviceId\n deviceType: $deviceType\n lock: $lock\n ) {\n res\n msg\n referenceId\n }\n}" }

hlas avatar Jun 02 '24 21:06 hlas