mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
idle and docked make button show
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
|||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
||||||
<title>Multi Roomba Rover</title>
|
<title>Multi Roomba Rover</title>
|
||||||
<script type="module" crossorigin src="/assets/index-RCmwOlNc.js"></script>
|
<script type="module" crossorigin src="/assets/index-Djed0CKH.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BrrBcPP-.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BrrBcPP-.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export default function VipNeatoCard({
|
|||||||
const charging = Boolean(neato?.telemetry?.chargingActive);
|
const charging = Boolean(neato?.telemetry?.chargingActive);
|
||||||
|
|
||||||
const uiStateLabel = humanizeUiState(neato?.telemetry?.uiState);
|
const uiStateLabel = humanizeUiState(neato?.telemetry?.uiState);
|
||||||
|
const uiStateRaw = normalizeState(neato?.telemetry?.uiState).toUpperCase();
|
||||||
const battery = neato?.telemetry?.batteryPercent;
|
const battery = neato?.telemetry?.batteryPercent;
|
||||||
const batteryLabel = Number.isFinite(battery) ? `${battery}%` : '--';
|
const batteryLabel = Number.isFinite(battery) ? `${battery}%` : '--';
|
||||||
const voltage = neato?.telemetry?.batteryVoltage;
|
const voltage = neato?.telemetry?.batteryVoltage;
|
||||||
@@ -73,7 +74,8 @@ export default function VipNeatoCard({
|
|||||||
const canClearErrors = Boolean(controls?.clearErrors?.available);
|
const canClearErrors = Boolean(controls?.clearErrors?.available);
|
||||||
|
|
||||||
const primaryAction = useMemo(() => {
|
const primaryAction = useMemo(() => {
|
||||||
if (docked) {
|
const looksDockedByState = uiStateRaw.includes('STATE_IDLE') || uiStateRaw.includes('STATE_STANDBY');
|
||||||
|
if (docked || looksDockedByState) {
|
||||||
return {
|
return {
|
||||||
key: 'start',
|
key: 'start',
|
||||||
label: 'Start cleaning',
|
label: 'Start cleaning',
|
||||||
@@ -91,7 +93,7 @@ export default function VipNeatoCard({
|
|||||||
canRun: canSendHome,
|
canRun: canSendHome,
|
||||||
fn: onSendHome,
|
fn: onSendHome,
|
||||||
};
|
};
|
||||||
}, [docked, canStart, onStart, canSendHome, onSendHome]);
|
}, [docked, uiStateRaw, canStart, onStart, canSendHome, onSendHome]);
|
||||||
|
|
||||||
const canRunPrimary = configured && connected && primaryAction.canRun;
|
const canRunPrimary = configured && connected && primaryAction.canRun;
|
||||||
const canRunLocate = configured && connected && canLocate;
|
const canRunLocate = configured && connected && canLocate;
|
||||||
|
|||||||
Reference in New Issue
Block a user