mirror of
https://github.com/Hypfer/Valetudo.git
synced 2025-10-26 11:27:27 +00:00
feat: OperationModeControlCapability: Vacuum then Mop Mode
This commit is contained in:
parent
6c3dd7eae4
commit
1937de9b0f
3
assets/icons/custom/presets/opmode/vacuum_then_mop.svg
Normal file
3
assets/icons/custom/presets/opmode/vacuum_then_mop.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="60" height="24" version="1.1" viewBox="0 0 60 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m51.488 0-0.81641 0.97656s-1.8946 2.2696-3.7949 5.1719c-1.9002 2.9022-3.8984 6.3457-3.8984 9.3398 0 4.688 3.8218 8.5117 8.5098 8.5117 4.688 0 8.5117-3.8237 8.5117-8.5117 0-1.25-0.35056-2.5774-0.89453-3.9121-0.759-1.8622-1.897-3.7371-3.0039-5.4277-1.9002-2.9023-3.7949-5.1719-3.7949-5.1719l-0.81836-0.97656zm-38.312 0.0019531a1.2692 1.2692 0 0 0-0.62695 0.19922c-2.9984 1.9312-5.0848 4.1913-6.0918 6.8125a1.2692 1.2692 0 0 0 0.73047 1.6406 1.2692 1.2692 0 0 0 1.6387-0.73047c0.761-1.9808 2.4052-3.8537 5.0977-5.5879a1.2692 1.2692 0 0 0 0.37891-1.7539 1.2692 1.2692 0 0 0-1.127-0.58008zm38.312 3.4512c0.5632 0.6982 1.4203 1.6992 2.8359 3.8613 1.494 2.2818 2.9195 5.0222 3.3867 6.9941-0.04856 0.0149-0.099007 0.028609-0.1543 0.037109-0.07286 0.01177-0.34925-0.003577-0.43945-0.023437-0.5104-0.1129-1.0937-0.44686-1.959-1.1211-0.28833-0.22465-0.41484-0.32537-1.0723-0.87109-1.4242-1.1823-2.0419-1.6416-2.8066-2.0801-0.9511-0.54536-1.849-0.81319-2.6953-0.80469-0.47494 0.00511-0.93364 0.10135-1.377 0.28125 0.45371-0.825 0.94465-1.6445 1.4473-2.4121 1.4157-2.1621 2.2707-3.1631 2.834-3.8613zm-50.213 2.6387a1.2692 1.2692 0 0 0-0.33008 0.041016 1.2692 1.2692 0 0 0-0.9043 1.5508c0.9101 3.4485 2.4159 6.1307 4.5977 7.8984a1.2692 1.2692 0 0 0 1.7852-0.1875 1.2692 1.2692 0 0 0-0.1875-1.7852c-1.6487-1.3358-2.9211-3.4777-3.7383-6.5742a1.2692 1.2692 0 0 0-1.2207-0.94336h-0.0019532zm13.895 0.0039062a1.2692 1.2692 0 0 0-1.334 1.2012 1.2692 1.2692 0 0 0 1.2012 1.334c2.119 0.1116 4.4075 1.0963 6.8887 3.1211a1.2692 1.2692 0 0 0 1.7871-0.18164 1.2692 1.2692 0 0 0-0.18164-1.7852c-2.7634-2.2549-5.5571-3.5417-8.3613-3.6895zm18.291 0.4043v2.75h-5.5v5.5h5.5v2.75l5.5-5.5-5.5-5.5zm-15.953 6.6562a1.2692 1.2692 0 0 0-0.32812 0.042969 1.2692 1.2692 0 0 0-0.89648 1.5547c0.5487 2.0497 0.31906 4.532-0.83984 7.5176a1.2692 1.2692 0 0 0 0.72461 1.6426 1.2692 1.2692 0 0 0 1.6426-0.72461c1.2907-3.3249 1.6499-6.3793 0.92383-9.0918a1.2692 1.2692 0 0 0-1.2266-0.94141zm-6.0371 4.4727a1.2692 1.2692 0 0 0-0.625 0.20117c-1.7799 1.1552-4.2105 1.705-7.4082 1.5254a1.2692 1.2692 0 0 0-1.3398 1.1973 1.2692 1.2692 0 0 0 1.1973 1.3379c3.561 0.20008 6.5762-0.40097 8.9316-1.9297a1.2692 1.2692 0 0 0 0.37305-1.7559 1.2692 1.2692 0 0 0-1.1289-0.57617z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@ -61,6 +61,7 @@ PresetSelectionStateAttribute.MODE = Object.freeze({
|
||||
VACUUM: "vacuum",
|
||||
MOP: "mop",
|
||||
VACUUM_AND_MOP: "vacuum_and_mop",
|
||||
VACUUM_THEN_MOP: "vacuum_then_mop"
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,8 @@
|
||||
|
||||
"vacuum",
|
||||
"mop",
|
||||
"vacuum_and_mop"
|
||||
"vacuum_and_mop",
|
||||
"vacuum_then_mop"
|
||||
]
|
||||
},
|
||||
"customValue": {
|
||||
|
||||
@ -40,7 +40,7 @@ export interface BatteryState {
|
||||
flag: "none" | "charged" | "charging" | "discharging";
|
||||
}
|
||||
|
||||
export type PresetValue = "off" | "min" | "low" | "medium" | "high" | "max" | "turbo" | "custom" | "vacuum" | "mop" | "vacuum_and_mop";
|
||||
export type PresetValue = "off" | "min" | "low" | "medium" | "high" | "max" | "turbo" | "custom" | "vacuum" | "mop" | "vacuum_and_mop" | "vacuum_then_mop";
|
||||
|
||||
export interface PresetSelectionState {
|
||||
__class: RobotAttributeClass.PresetSelectionState;
|
||||
|
||||
@ -167,3 +167,11 @@ export const OperationModeVacuumAndMop = createSvgIcon(
|
||||
</svg>,
|
||||
"operationModeVacuumAndMop"
|
||||
);
|
||||
|
||||
export const OperationModeVacuumThenMop = createSvgIcon(
|
||||
<svg width="60" height="24" version="1.1" viewBox="0 0 60 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="m51.488 0-0.81641 0.97656s-1.8946 2.2696-3.7949 5.1719c-1.9002 2.9022-3.8984 6.3457-3.8984 9.3398 0 4.688 3.8218 8.5117 8.5098 8.5117 4.688 0 8.5117-3.8237 8.5117-8.5117 0-1.25-0.35056-2.5774-0.89453-3.9121-0.759-1.8622-1.897-3.7371-3.0039-5.4277-1.9002-2.9023-3.7949-5.1719-3.7949-5.1719l-0.81836-0.97656zm-38.312 0.0019531a1.2692 1.2692 0 0 0-0.62695 0.19922c-2.9984 1.9312-5.0848 4.1913-6.0918 6.8125a1.2692 1.2692 0 0 0 0.73047 1.6406 1.2692 1.2692 0 0 0 1.6387-0.73047c0.761-1.9808 2.4052-3.8537 5.0977-5.5879a1.2692 1.2692 0 0 0 0.37891-1.7539 1.2692 1.2692 0 0 0-1.127-0.58008zm38.312 3.4512c0.5632 0.6982 1.4203 1.6992 2.8359 3.8613 1.494 2.2818 2.9195 5.0222 3.3867 6.9941-0.04856 0.0149-0.099007 0.028609-0.1543 0.037109-0.07286 0.01177-0.34925-0.003577-0.43945-0.023437-0.5104-0.1129-1.0937-0.44686-1.959-1.1211-0.28833-0.22465-0.41484-0.32537-1.0723-0.87109-1.4242-1.1823-2.0419-1.6416-2.8066-2.0801-0.9511-0.54536-1.849-0.81319-2.6953-0.80469-0.47494 0.00511-0.93364 0.10135-1.377 0.28125 0.45371-0.825 0.94465-1.6445 1.4473-2.4121 1.4157-2.1621 2.2707-3.1631 2.834-3.8613zm-50.213 2.6387a1.2692 1.2692 0 0 0-0.33008 0.041016 1.2692 1.2692 0 0 0-0.9043 1.5508c0.9101 3.4485 2.4159 6.1307 4.5977 7.8984a1.2692 1.2692 0 0 0 1.7852-0.1875 1.2692 1.2692 0 0 0-0.1875-1.7852c-1.6487-1.3358-2.9211-3.4777-3.7383-6.5742a1.2692 1.2692 0 0 0-1.2207-0.94336h-0.0019532zm13.895 0.0039062a1.2692 1.2692 0 0 0-1.334 1.2012 1.2692 1.2692 0 0 0 1.2012 1.334c2.119 0.1116 4.4075 1.0963 6.8887 3.1211a1.2692 1.2692 0 0 0 1.7871-0.18164 1.2692 1.2692 0 0 0-0.18164-1.7852c-2.7634-2.2549-5.5571-3.5417-8.3613-3.6895zm18.291 0.4043v2.75h-5.5v5.5h5.5v2.75l5.5-5.5-5.5-5.5zm-15.953 6.6562a1.2692 1.2692 0 0 0-0.32812 0.042969 1.2692 1.2692 0 0 0-0.89648 1.5547c0.5487 2.0497 0.31906 4.532-0.83984 7.5176a1.2692 1.2692 0 0 0 0.72461 1.6426 1.2692 1.2692 0 0 0 1.6426-0.72461c1.2907-3.3249 1.6499-6.3793 0.92383-9.0918a1.2692 1.2692 0 0 0-1.2266-0.94141zm-6.0371 4.4727a1.2692 1.2692 0 0 0-0.625 0.20117c-1.7799 1.1552-4.2105 1.705-7.4082 1.5254a1.2692 1.2692 0 0 0-1.3398 1.1973 1.2692 1.2692 0 0 0 1.1973 1.3379c3.561 0.20008 6.5762-0.40097 8.9316-1.9297a1.2692 1.2692 0 0 0 0.37305-1.7559 1.2692 1.2692 0 0 0-1.1289-0.57617z"/>
|
||||
</svg>,
|
||||
"operationModeVacuumAndMop"
|
||||
);
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
OperationModeMop,
|
||||
OperationModeVacuum,
|
||||
OperationModeVacuumAndMop,
|
||||
OperationModeVacuumThenMop,
|
||||
WaterGradeHighIcon,
|
||||
WaterGradeLowIcon,
|
||||
WaterGradeMaxIcon,
|
||||
@ -19,7 +20,7 @@ import {
|
||||
WaterGradeOffIcon
|
||||
} from "./components/CustomIcons";
|
||||
|
||||
const order: Array<PresetValue> = ["off", "min", "low", "medium", "high", "max", "turbo", "vacuum", "vacuum_and_mop", "mop"];
|
||||
const order: Array<PresetValue> = ["off", "min", "low", "medium", "high", "max", "turbo", "vacuum", "vacuum_and_mop", "vacuum_then_mop", "mop"];
|
||||
export const sortPresets = (presets: PresetSelectionState["value"][]) => {
|
||||
return [...presets].sort((a, b) => {
|
||||
return order.indexOf(a) - order.indexOf(b);
|
||||
@ -37,6 +38,7 @@ export const presetFriendlyNames: {[key in PresetValue]: string} = Object.freeze
|
||||
"custom": "Custom",
|
||||
|
||||
"vacuum_and_mop": "Vacuum & Mop",
|
||||
"vacuum_then_mop": "Vacuum then Mop",
|
||||
"vacuum": "Vacuum",
|
||||
"mop": "Mop"
|
||||
});
|
||||
@ -88,6 +90,8 @@ export function getPresetIconOrLabel(capability: Capability, preset: PresetValue
|
||||
return <OperationModeMop style={style}/>;
|
||||
case "vacuum_and_mop":
|
||||
return <OperationModeVacuumAndMop style={style}/>;
|
||||
case "vacuum_then_mop":
|
||||
return <OperationModeVacuumThenMop style={style}/>;
|
||||
default:
|
||||
return presetFriendlyNames[preset];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user