This commit is contained in:
legop3
2026-04-26 21:09:11 -04:00
parent c28cb4bb20
commit 304c984423
9 changed files with 196 additions and 150 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -11,8 +11,8 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-EI4GBqvV.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-IQlwhkNm.css">
<script type="module" crossorigin src="/assets/index-wLjyvnCl.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-pfHsbpoo.css">
</head>
<body>
<div id="root"></div>
+22
View File
@@ -34,6 +34,7 @@ const ENTITY_IDS = {
start: entityId('button', 'house_clean'),
sendHome: entityId('button', 'send_to_base'),
locate: entityId('button', 'locate_robot'),
clearErrors: entityId('button', 'clear_errors'),
},
sensors: {
batteryPercent: entityId('sensor', 'fuel_percent'),
@@ -92,6 +93,10 @@ function buildState() {
entityId: ENTITY_IDS.buttons.locate,
available: hasEntity(ENTITY_IDS.buttons.locate),
},
clearErrors: {
entityId: ENTITY_IDS.buttons.clearErrors,
available: hasEntity(ENTITY_IDS.buttons.clearErrors),
},
};
const batteryPercentValue = parseNumber(readState(ENTITY_IDS.sensors.batteryPercent));
@@ -179,6 +184,10 @@ async function locateRobot() {
await pressButton(ENTITY_IDS.buttons.locate, 'locate');
}
async function clearErrors() {
await pressButton(ENTITY_IDS.buttons.clearErrors, 'clear_errors');
}
function getState() {
cachedState = buildState();
return cachedState;
@@ -220,6 +229,18 @@ io.on('connection', (socket) => {
cb({ error: err.message });
}
});
socket.on('neato:clearErrors', async (_, cb = () => {}) => {
try {
if (!isVerified(socket)) {
throw new Error('VIP verification required');
}
await clearErrors();
cb({ success: true });
} catch (err) {
cb({ error: err.message });
}
});
});
emitUpdate();
@@ -229,5 +250,6 @@ module.exports = {
startCleaning,
sendHome,
locateRobot,
clearErrors,
neatoEvents: events,
};