]> git.basschouten.com Git - openhab-addons.git/blob
a6ee37e7f74e754833873531b38bdd326aca2846
[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 Errors
19  * derived from vacuum_cleaner-EN.pdf
20  *
21  * @author Marcel Verpaalen - Initial contribution
22  */
23 @NonNullByDefault
24 public enum VacuumErrorType {
25
26     ERROR00(0, "No error"),
27     ERROR01(1, "Laser sensor fault"),
28     ERROR02(2, "Collision sensor fault"),
29     ERROR03(3, "Wheel floating"),
30     ERROR04(4, "Cliff sensor fault"),
31     ERROR05(5, "Main brush blocked"),
32     ERROR06(6, "Side brush blocked"),
33     ERROR07(7, "Wheel blocked"),
34     ERROR08(8, "Device stuck"),
35     ERROR09(9, "Dust bin missing"),
36     ERROR10(10, "Filter blocked"),
37     ERROR11(11, "Magnetic field detected"),
38     ERROR12(12, "Low battery"),
39     ERROR13(13, "Charging problem"),
40     ERROR14(14, "Battery failure"),
41     ERROR15(15, "Wall sensor fault"),
42     ERROR16(16, "Uneven surface"),
43     ERROR17(17, "Side brush failure"),
44     ERROR18(18, "Suction fan failure"),
45     ERROR19(19, "Unpowered charging station"),
46     ERROR20(20, "Unknown Error"),
47     ERROR21(21, "Laser pressure sensor problem"),
48     ERROR22(22, "Charge sensor problem"),
49     ERROR23(23, "Dock problem"),
50     ERROR24(24, "No-go zone or invisible wall detected"),
51     ERROR254(254, "Bin full"),
52     ERROR255(255, "Internal error"),
53     UNKNOWN(-1, "Unknown Error");
54
55     private final int id;
56     private final String description;
57
58     VacuumErrorType(int id, String description) {
59         this.id = id;
60         this.description = description;
61     }
62
63     public int getId() {
64         return id;
65     }
66
67     public static VacuumErrorType getType(int value) {
68         for (VacuumErrorType st : VacuumErrorType.values()) {
69             if (st.getId() == value) {
70                 return st;
71             }
72         }
73         return UNKNOWN;
74     }
75
76     public String getDescription() {
77         return description;
78     }
79
80     @Override
81     public String toString() {
82         return "Error " + Integer.toString(id) + ": " + description;
83     }
84 }