]> git.basschouten.com Git - openhab-addons.git/blob
5f42ad3786367ef77af75123215eb2ff77a1e98c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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     SEGMENT_CLEAN("", "actions#segment", "miio:segment");
33
34     private final String statusFieldName;
35     private final String channel;
36     private final String channelType;
37
38     RobotCababilities(String statusKey, String channel, String channelType) {
39         this.statusFieldName = statusKey;
40         this.channel = channel;
41         this.channelType = channelType;
42     }
43
44     public String getStatusFieldName() {
45         return statusFieldName;
46     }
47
48     public String getChannel() {
49         return channel;
50     }
51
52     public ChannelTypeUID getChannelType() {
53         return new ChannelTypeUID(channelType);
54     }
55
56     @Override
57     public String toString() {
58         return String.format("Capability %s: status field name: '%s', channel: '%s', channeltype: '%s'.", this.name(),
59                 statusFieldName, channel, channelType);
60     }
61 }