move neato and lift into activities

This commit is contained in:
legop3
2026-06-23 12:36:21 -04:00
parent 0a351b9a46
commit 5634004ebd
9 changed files with 72 additions and 81 deletions
+8 -15
View File
@@ -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) {