mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -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-title" content="Multi Roomba Rover" />
|
||||
<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">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -56,6 +56,7 @@ export default function VipNeatoCard({
|
||||
const charging = Boolean(neato?.telemetry?.chargingActive);
|
||||
|
||||
const uiStateLabel = humanizeUiState(neato?.telemetry?.uiState);
|
||||
const uiStateRaw = normalizeState(neato?.telemetry?.uiState).toUpperCase();
|
||||
const battery = neato?.telemetry?.batteryPercent;
|
||||
const batteryLabel = Number.isFinite(battery) ? `${battery}%` : '--';
|
||||
const voltage = neato?.telemetry?.batteryVoltage;
|
||||
@@ -73,7 +74,8 @@ export default function VipNeatoCard({
|
||||
const canClearErrors = Boolean(controls?.clearErrors?.available);
|
||||
|
||||
const primaryAction = useMemo(() => {
|
||||
if (docked) {
|
||||
const looksDockedByState = uiStateRaw.includes('STATE_IDLE') || uiStateRaw.includes('STATE_STANDBY');
|
||||
if (docked || looksDockedByState) {
|
||||
return {
|
||||
key: 'start',
|
||||
label: 'Start cleaning',
|
||||
@@ -91,7 +93,7 @@ export default function VipNeatoCard({
|
||||
canRun: canSendHome,
|
||||
fn: onSendHome,
|
||||
};
|
||||
}, [docked, canStart, onStart, canSendHome, onSendHome]);
|
||||
}, [docked, uiStateRaw, canStart, onStart, canSendHome, onSendHome]);
|
||||
|
||||
const canRunPrimary = configured && connected && primaryAction.canRun;
|
||||
const canRunLocate = configured && connected && canLocate;
|
||||
|
||||
Reference in New Issue
Block a user