]> git.basschouten.com Git - openhab-addons.git/blob
2d8d5dc339a6266edd03b3cd296e67249d3f2faf
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.miio.internal.robot;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.type.ChannelTypeUID;
17
18 /**
19  * List of additional capabilities
20  *
21  * @author Marcel Verpaalen - Initial contribution
22  */
23 @NonNullByDefault
24 public enum RobotCababilities {
25
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",
30             "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_CLEAN("", "actions#segment", "miio:segment");
34
35     private final String statusFieldName;
36     private final String channel;
37     private final String channelType;
38
39     RobotCababilities(String statusKey, String channel, String channelType) {
40         this.statusFieldName = statusKey;
41         this.channel = channel;
42         this.channelType = channelType;
43     }
44
45     public String getStatusFieldName() {
46         return statusFieldName;
47     }
48
49     public String getChannel() {
50         return channel;
51     }
52
53     public ChannelTypeUID getChannelType() {
54         return new ChannelTypeUID(channelType);
55     }
56
57     @Override
58     public String toString() {
59         return String.format("Capability %s: status field name: '%s', channel: '%s', channeltype: '%s'.", this.name(),
60                 statusFieldName, channel, channelType);
61     }
62 }