setHuanoidDetection method
设置人形检测开关
Implementation
Future<bool> setHuanoidDetection(int value, {int timeout = 5}) async {
bool ret = await writeCgi(
"trans_cmd_string.cgi?cmd=2106&command=4&humanDetection=$pirLevel&DistanceAdjust=$distanceAdjust&HumanoidDetection=$value&",
timeout: timeout);
if (ret) {
CommandResult result = await waitCommandResult((int cmd, Uint8List data) {
if (cmd == 24785) {
String str = utf8.decode(data);
return str.contains("cmd=2106;") && str.contains("command=4;");
}
return false;
}, timeout);
if (result.isSuccess) {
Map data = result.getMap();
if (data["result"] == "0") {
humanDetection = value; //note
humanoidDetection = value;
return true;
}
}
}
return false;
}