]> git.basschouten.com Git - openhab-addons.git/blob
52f4ca359afff6e3ecc3005fbce62e295825f903
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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     RETURNING_HOME(22, "Returning Home"),
45     FULL(100, "Full"),
46     OFFLINE(101, "Device Offline");
47
48     private final int id;
49     private final String description;
50
51     StatusType(int id, String description) {
52         this.id = id;
53         this.description = description;
54     }
55
56     public int getId() {
57         return id;
58     }
59
60     public static StatusType getType(int value) {
61         for (StatusType st : StatusType.values()) {
62             if (st.getId() == value) {
63                 return st;
64             }
65         }
66         return UNKNOWN;
67     }
68
69     public String getDescription() {
70         return description;
71     }
72
73     @Override
74     public String toString() {
75         return "Status " + Integer.toString(id) + ": " + description;
76     }
77 }