mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 10:00:46 -04:00
move neato and lift into activities
This commit is contained in:
@@ -265,9 +265,8 @@ io.on('connection', (socket) => {
|
||||
socket.on('neato:start', async (_, cb = () => {}) => {
|
||||
try {
|
||||
assertLockdownAccess();
|
||||
if (!isVerified(socket)) {
|
||||
throw new Error('VIP verification required');
|
||||
}
|
||||
// Neato commands are public activity features. The lockdown check above
|
||||
// remains the room-wide safety/admin gate when the server is restricted.
|
||||
await startCleaning();
|
||||
cb({ success: true });
|
||||
} catch (err) {
|
||||
@@ -278,9 +277,7 @@ io.on('connection', (socket) => {
|
||||
socket.on('neato:sendHome', async (_, cb = () => {}) => {
|
||||
try {
|
||||
assertLockdownAccess();
|
||||
if (!isVerified(socket)) {
|
||||
throw new Error('VIP verification required');
|
||||
}
|
||||
// Keep send-home public for consistency with the rest of the Neato card.
|
||||
await sendHome();
|
||||
cb({ success: true });
|
||||
} catch (err) {
|
||||
@@ -291,9 +288,7 @@ io.on('connection', (socket) => {
|
||||
socket.on('neato:locate', async (_, cb = () => {}) => {
|
||||
try {
|
||||
assertLockdownAccess();
|
||||
if (!isVerified(socket)) {
|
||||
throw new Error('VIP verification required');
|
||||
}
|
||||
// Locate is a public activity action; lockdown still blocks it above.
|
||||
await locateRobot();
|
||||
cb({ success: true });
|
||||
} catch (err) {
|
||||
@@ -304,9 +299,8 @@ io.on('connection', (socket) => {
|
||||
socket.on('neato:clearErrors', async (_, cb = () => {}) => {
|
||||
try {
|
||||
assertLockdownAccess();
|
||||
if (!isVerified(socket)) {
|
||||
throw new Error('VIP verification required');
|
||||
}
|
||||
// Error clearing is grouped with the public Neato controls so the UI does
|
||||
// not show a button that only some public users can actually run.
|
||||
await clearErrors();
|
||||
cb({ success: true });
|
||||
} catch (err) {
|
||||
@@ -317,9 +311,8 @@ io.on('connection', (socket) => {
|
||||
socket.on('neato:powerCycle', async (_, cb = () => {}) => {
|
||||
try {
|
||||
assertLockdownAccess();
|
||||
if (!isVerified(socket)) {
|
||||
throw new Error('VIP verification required');
|
||||
}
|
||||
// Power cycle follows the same public policy as the rest of the card;
|
||||
// operational safety remains controlled by lockdown mode.
|
||||
await powerCycle();
|
||||
cb({ success: true });
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user