From df3a6bb175ad7084b9f0841263a48815d4c886ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Chirico=20Indreb=C3=B8?= Date: Tue, 29 Oct 2024 12:23:16 +0100 Subject: [PATCH] Show robot as busy when driving home --- backend/api/Database/Context/InitDb.cs | 1 + .../components/Displays/RobotDisplays/RobotStatusIcon.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/api/Database/Context/InitDb.cs b/backend/api/Database/Context/InitDb.cs index fc9992bef..68ae5bf4c 100644 --- a/backend/api/Database/Context/InitDb.cs +++ b/backend/api/Database/Context/InitDb.cs @@ -651,6 +651,7 @@ public static void AddRobotModelsToContext(FlotillaDbContext context) { Type = type, BatteryWarningThreshold = null, + BatteryMissionStartThreshold = null, LowerPressureWarningThreshold = null, UpperPressureWarningThreshold = null }; diff --git a/frontend/src/components/Displays/RobotDisplays/RobotStatusIcon.tsx b/frontend/src/components/Displays/RobotDisplays/RobotStatusIcon.tsx index 54676b088..68eff40a3 100644 --- a/frontend/src/components/Displays/RobotDisplays/RobotStatusIcon.tsx +++ b/frontend/src/components/Displays/RobotDisplays/RobotStatusIcon.tsx @@ -65,11 +65,15 @@ export const RobotStatusChip = ({ status, flotillaStatus, isarConnected }: Statu iconColor = tokens.colors.interactive.disabled__text.hex statusIcon = Icons.Info status = RobotStatus.ConnectionIssues - } else if (flotillaStatus && flotillaStatus === RobotFlotillaStatus.SafeZone) { + } else if (flotillaStatus && status === RobotStatus.Available && flotillaStatus === RobotFlotillaStatus.SafeZone) { iconColor = tokens.colors.interactive.danger__resting.hex statusIcon = Icons.Warning status = RobotStatus.SafeZone - } else if (flotillaStatus && flotillaStatus === RobotFlotillaStatus.Recharging) { + } else if ( + flotillaStatus && + status === RobotStatus.Available && + flotillaStatus === RobotFlotillaStatus.Recharging + ) { iconColor = '#FFC300' statusIcon = Icons.BatteryCharging status = RobotStatus.Recharging