AWS IoT Button触发后仅返回三个参数?技术问询
Hey there fellow AWS IoT developer! 😊
I’ve confirmed that when you press an Amazon IoT Button, it will only send the three core parameters shown in the code snippet below by default:
// Amazon的IoT Button被按下时会发送三个参数... var body = JSON.stringify({ clickType: event.clickType, // (string) 按键类型;可选值为"SINGLE"、"DOUBLE"或"LONG" serialNumber: event.serialNumber, // (string) 设备序列号,位于按钮背面 batteryVoltage: event.batteryVoltage // (string) 设备电池电压,单位为毫伏,例如"1567" })
Let me break down each parameter for clarity:
- clickType: A string that indicates how the button was pressed. Valid values are "SINGLE", "DOUBLE", or "LONG" — this is super useful for triggering different actions based on the press type.
- serialNumber: A unique string identifier for your button, which you can find printed on the back of the device. This helps you distinguish between multiple buttons if you have a fleet deployed.
- batteryVoltage: A string representing the button's battery level in millivolts (e.g., "1567"). You can use this to monitor when the battery needs replacement.
内容的提问来源于stack exchange,提问作者James Watson
相关产品推荐
相关产品推荐

