CH340 8 Relays Driver API Information
1. Send Status
Description:This API can be used to send status to relay device, which use 8-bit binary number to discribe the status.
URI: /relay/act
Method: POST
Header: Authrization: {token}
Body: {"status": x, "stay": x} (status is a number change by binary number, like 6=0b00000110. stay is staying duration(second) of this status, 0 means forever.)
Return: 200 success
Error: 401 (authorized failed)
400 (miss parameters)
500 (no relay device connected)
500 (set relay status failed)