语音助手状态查询问题
点灯的设备可以用语音助手查询状态吗?应该是用哪个函数?求大佬们解答 https://diandeng.tech/doc/voice-assistant void miotPowerState(const String & state){
BLINKER_LOG("need set power state: ", state);
if (state == BLINKER_CMD_ON) {
WOL_packet_transfer();
Blinker.delay(200);
WOL_packet_transfer();
Blinker.delay(200);
WOL_packet_transfer();
BlinkerMIOT.powerState("on");
BlinkerMIOT.print();
oState = true;
}
else if (state == BLINKER_CMD_OFF) {
digitalWrite(0, LOW);
Blinker.delay(200);
digitalWrite(0, HIGH);
BlinkerMIOT.powerState("off");
BlinkerMIOT.print();
oState = false;
}
}
void miotQuery(int32_t queryCode)
{
BLINKER_LOG("MIOT Query codes: ", queryCode);
switch (queryCode)
{
case BLINKER_CMD_QUERY_ALL_NUMBER :
BLINKER_LOG("MIOT Query All");
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
case BLINKER_CMD_QUERY_POWERSTATE_NUMBER :
BLINKER_LOG(" 电脑开关 ");
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
default :
BlinkerMIOT.powerState(oState ? "on" : "off");
BlinkerMIOT.print();
break;
}
}
我按照例程改的,但是没小爱查询状态还是找不到目标呢
页:
[1]