mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
night vision fix
This commit is contained in:
@@ -198,9 +198,10 @@ function turnOffAllRoverNightVision() {
|
|||||||
const records = Array.from(roverManager.rovers.values());
|
const records = Array.from(roverManager.rovers.values());
|
||||||
let attempted = 0;
|
let attempted = 0;
|
||||||
let failed = 0;
|
let failed = 0;
|
||||||
|
const roverIds = [];
|
||||||
records.forEach((record) => {
|
records.forEach((record) => {
|
||||||
if (!record?.ws) return;
|
if (!record?.ws) return;
|
||||||
if (!record?.meta?.nightVision?.enabled) return;
|
roverIds.push(String(record.id));
|
||||||
attempted += 1;
|
attempted += 1;
|
||||||
try {
|
try {
|
||||||
issueCommand(record.id, {
|
issueCommand(record.id, {
|
||||||
@@ -215,7 +216,7 @@ function turnOffAllRoverNightVision() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return { attempted, failed };
|
return { attempted, failed, roverIds };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getActiveDriverCount() {
|
function getActiveDriverCount() {
|
||||||
@@ -256,6 +257,7 @@ function scheduleLightsIdleOffTimer() {
|
|||||||
idleMs: LIGHT_IDLE_OFF_MS,
|
idleMs: LIGHT_IDLE_OFF_MS,
|
||||||
nightVisionRovers: nightVisionResult.attempted,
|
nightVisionRovers: nightVisionResult.attempted,
|
||||||
nightVisionFailures: nightVisionResult.failed,
|
nightVisionFailures: nightVisionResult.failed,
|
||||||
|
nightVisionRoverIds: nightVisionResult.roverIds,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.warn('Failed auto light-off after idle', err.message);
|
logger.warn('Failed auto light-off after idle', err.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user