2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.miio.internal.robot;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.type.ChannelTypeUID;
19 * List of additional capabilities
21 * @author Marcel Verpaalen - Initial contribution
24 public enum RobotCababilities {
26 WATERBOX_STATUS("water_box_status", "status#water_box_status", "miio:water_box_status", ""),
27 LOCKSTATUS("lock_status", "status#lock_status", "miio:lock_status", ""),
28 WATERBOX_MODE("water_box_mode", "status#water_box_mode", "miio:water_box_mode", ""),
29 WATERBOX_CARRIAGE("water_box_carriage_status", "status#water_box_carriage_status", "miio:water_box_carriage_status",
31 MOP_FORBIDDEN("mop_forbidden_enable", "status#mop_forbidden_enable", "miio:mop_forbidden_enable", ""),
32 LOCATING("is_locating", "status#is_locating", "miio:is_locating", ""),
33 SEGMENT_STATUS("", "status#segment_status", "miio:segment_status", "get_segment_status"),
34 MAP_STATUS("", "status#map_status", "miio:map_status", "get_map_status"),
35 LED_STATUS("", "status#led_status", "miio:led_status", "get_led_status"),
36 CARPET_MODE("", "info#carpet_mode", "miio:carpet_mode", "get_carpet_mode"),
37 FW_FEATURES("", "info#fw_features", "miio:fw_features", "get_fw_features"),
38 ROOM_MAPPING("", "info#room_mapping", "miio:room_mapping", "get_room_mapping"),
39 MULTI_MAP_LIST("", "info#multi_maps_list", "miio:multi_maps_list", "get_multi_maps_list"),
40 CUSTOMIZE_CLEAN_MODE("", "info#customize_clean_mode", "miio:customize_clean_mode", "get_customize_clean_mode"),
41 SEGMENT_CLEAN("", "actions#segment", "miio:segment", "");
43 private final String statusFieldName;
44 private final String channel;
45 private final String channelType;
46 private final String command;
48 RobotCababilities(String statusKey, String channel, String channelType, String command) {
49 this.statusFieldName = statusKey;
50 this.channel = channel;
51 this.channelType = channelType;
52 this.command = command;
55 public String getStatusFieldName() {
56 return statusFieldName;
59 public String getChannel() {
63 public ChannelTypeUID getChannelType() {
64 return new ChannelTypeUID(channelType);
67 public String getCommand() {
72 public String toString() {
73 return String.format("Capability %s: status field name: '%s', channel: '%s', channeltype: '%s'%s%s.",
74 this.name(), statusFieldName, channel, channelType, command.isBlank() ? "" : ", custom command: ",