Commit 743ae110 by zeven

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

parent 998c22ec
...@@ -119,10 +119,17 @@ class App extends React.Component { ...@@ -119,10 +119,17 @@ class App extends React.Component {
}); });
} }
if (!window.socket.hasListeners('tcpRelay')) { if (!window.socket.hasListeners('tcpRelay')) {
window.socket.on('tcpRelay', async ({ip, port, route, status}) => { window.socket.on(
const ret = await TcpRelay.toggle(ip, port, route, status); 'tcpRelay',
Speech.speak(`远程继电器触发${ret ? '成功' : '失败'}`); 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