]> git.basschouten.com Git - openhab-addons.git/blob
9956f4ce958cbe365797357b55d9fdd7de613493
[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
17 /**
18  * List of available states
19  *
20  * @author Marcel Verpaalen - Initial contribution
21  */
22 @NonNullByDefault
23 public enum StatusType {
24
25     UNKNOWN(0, "Unknown"),
26     INITIATING(1, "Initiating"),
27     SLEEPING(2, "Sleeping"),
28     IDLE(3, "Idle"),
29     REMOTE(4, "Remote Control"),
30     CLEANING(5, "Cleaning"),
31     RETURNING(6, "Returning Dock"),
32     MANUAL(7, "Manual Mode"),
33     CHARGING(8, "Charging"),
34     CHARGING_ERROR(9, "Charging Error"),
35     PAUSED(10, "Paused"),
36     SPOTCLEAN(11, "Spot cleaning"),
37     ERROR(12, "In Error"),
38     SHUTTING_DOWN(13, "Shutting Down"),
39     UPDATING(14, "Updating"),
40     DOCKING(15, "Docking"),
41     GOTO(16, "Go To"),
42     ZONE(17, "Zone Clean"),
43     ROOM(18, "Room Clean"),
44     FULL(100, "Full");
45
46     private final int id;
47     private final String description;
48
49     StatusType(int id, String description) {
50         this.id = id;
51         this.description = description;
52     }
53
54     public int getId() {
55         return id;
56     }
57
58     public static StatusType getType(int value) {
59         for (StatusType st : StatusType.values()) {
60             if (st.getId() == value) {
61                 return st;
62             }
63         }
64         return UNKNOWN;
65     }
66
67     public String getDescription() {
68         return description;
69     }
70
71     @Override
72     public String toString() {
73         return "Status " + Integer.toString(id) + ": " + description;
74     }
75 }