headlight rework and laser addition

This commit is contained in:
legop3
2026-06-27 15:57:47 -04:00
parent 3c1b1dab6e
commit 8e322ed57b
45 changed files with 596 additions and 373 deletions
+6 -6
View File
@@ -8,7 +8,7 @@ const homeAssistantService = require('../homeAssistantService');
const neatoService = require('../neatoService');
const liftService = require('../liftService');
const {
NIGHT_VISION_DISABLE_ACTION,
HEADLIGHT_DISABLE_ACTION,
DOCK_COMMAND_BASE64,
} = require('./constants');
@@ -60,7 +60,7 @@ async function dockAllRovers() {
return { action: 'dockAllRovers', attempted, failed };
}
async function disableAllRoverNightVision() {
async function disableAllRoverHeadlights() {
const attempted = [];
const failed = [];
roverManager.rovers.forEach((record) => {
@@ -68,15 +68,15 @@ async function disableAllRoverNightVision() {
const roverId = String(record.id);
try {
issueCommand(roverId, {
type: 'nightVision',
nightVision: { action: NIGHT_VISION_DISABLE_ACTION },
type: 'headlight',
headlight: { action: HEADLIGHT_DISABLE_ACTION },
});
attempted.push(roverId);
} catch (err) {
failed.push({ roverId, error: err.message });
}
});
return { action: 'disableRoverNightVision', attempted, failed };
return { action: 'disableRoverHeadlights', attempted, failed };
}
async function sendNeatoHome() {
@@ -100,7 +100,7 @@ async function raiseLift() {
const idleActions = [
turnOffRoomControls,
// dockAllRovers,
disableAllRoverNightVision,
disableAllRoverHeadlights,
sendNeatoHome,
raiseLift,
];
+2 -2
View File
@@ -2,11 +2,11 @@
// Purpose: Defines idle timing and command constants used by idle automation workflows.
// Scope: Centralizes immutable configuration for trigger windows and rover command payloads.
const IDLE_TIMEOUT_MS = 2 * 60 * 1000;
const NIGHT_VISION_DISABLE_ACTION = 'on';
const HEADLIGHT_DISABLE_ACTION = 'off';
const DOCK_COMMAND_BASE64 = Buffer.from([143]).toString('base64');
module.exports = {
IDLE_TIMEOUT_MS,
NIGHT_VISION_DISABLE_ACTION,
HEADLIGHT_DISABLE_ACTION,
DOCK_COMMAND_BASE64,
};