剩下的就是打开树莓派的灯泡了。
<DeviceTypeConfiguration name="raspberrypi">
<Features>
<Feature code="bulb">
<Name>Control Bulb</Name>
<Description>Control Bulb on Raspberrypi</Description>
<Operation context="/raspberrypi/device/{deviceId}/bulb" method="POST">
<QueryParameters>
<Parameter>state</Parameter>
</QueryParameters>
</Operation>
</Feature>
</Features>
在这里,QueryParameter状态代表打开和关闭。像吼叫
curl -v -k -X POST "https://localhost:8243/raspberrypi/1.0.0/device/vf98e6a7atyp/bulb?state=off" -H "accept: application/json" -H "Authorization: Bearer beec80da-4d83-36a9-ad82-a33e5bdbad70"
但是状态只能接受开,关,开,关的值。有人可以告诉我验证状态值的文件名吗?
因为我想添加更多的值,而不是on,off,ON,OFF。
非常感谢您的帮助。