Commit 743ae110 by zeven

增加远程开关延迟关闭参数

parent 998c22ec
......@@ -119,10 +119,17 @@ class App extends React.Component {
});
}
if (!window.socket.hasListeners('tcpRelay')) {
window.socket.on('tcpRelay', async ({ip, port, route, status}) => {
const ret = await TcpRelay.toggle(ip, port, route, status);
Speech.speak(`远程继电器触发${ret ? '成功' : '失败'}`);
});
window.socket.on(
'tcpRelay',
async ({ip, port, route, status, delay: _delay}) => {
port = Number(port);
route = Number(route);
status = Number(status);
_delay = Number(_delay);
const ret = await TcpRelay.toggle(ip, port, route, status, _delay);
Speech.speak(`远程开关触发${ret ? '成功' : '失败'}`);
},
);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment