]> git.basschouten.com Git - openhab-addons.git/blob
15a6481c1acdfd577b111ba9ba8ad14d8b147c7d
[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.neato.internal.classes;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link Cleaning} is the internal class for different Cleaning states and related information.
19  *
20  * @author Patrik Wimnell - Initial contribution
21  */
22 public class Cleaning {
23
24     @SerializedName("category")
25     private Integer categoryValue;
26     @SerializedName("mode")
27     private Integer modeValue;
28     @SerializedName("modifier")
29     private Integer modifierValue;
30     @SerializedName("navigationMode")
31     private Integer navigationModeValue;
32     private Integer spotWidth;
33     private Integer spotHeight;
34
35     public enum Category {
36         MANUAL(1),
37         HOUSE(2),
38         SPOT(3),
39         MAP(4),
40         UNRECOGNIZED(-1);
41
42         private int value;
43
44         private Category(int value) {
45             this.value = value;
46         }
47
48         public static Category fromValue(int value) {
49             for (Category c : values()) {
50                 if (c.value == value) {
51                     return c;
52                 }
53             }
54             return UNRECOGNIZED;
55         }
56     }
57
58     public enum Mode {
59         ECO(1),
60         TURBO(2);
61
62         private int value;
63
64         private Mode(int value) {
65             this.value = value;
66         }
67
68         public static Mode fromValue(int value) {
69             for (Mode m : values()) {
70                 if (m.value == value) {
71                     return m;
72                 }
73             }
74             return TURBO;
75         }
76     }
77
78     public enum Modifier {
79         NORMAL(1),
80         DOUBLE(2);
81
82         private int value;
83
84         private Modifier(int value) {
85             this.value = value;
86         }
87
88         public static Modifier fromValue(int value) {
89             for (Modifier m : values()) {
90                 if (m.value == value) {
91                     return m;
92                 }
93             }
94             return NORMAL;
95         }
96     }
97
98     public enum NavigationMode {
99         NORMAL(1),
100         EXTRA_CARE(2),
101         DEEP(3);
102
103         private int value;
104
105         private NavigationMode(int value) {
106             this.value = value;
107         }
108
109         public static NavigationMode fromValue(int value) {
110             for (NavigationMode m : values()) {
111                 if (m.value == value) {
112                     return m;
113                 }
114             }
115             return NORMAL;
116         }
117     }
118
119     public Integer getCategoryValue() {
120         return categoryValue;
121     }
122
123     public void setCategoryValue(Integer categoryValue) {
124         this.categoryValue = categoryValue;
125     }
126
127     public Category getCategory() {
128         return Category.fromValue(categoryValue);
129     }
130
131     public Integer getModeValue() {
132         return modeValue;
133     }
134
135     public void setModeValue(Integer modeValue) {
136         this.modeValue = modeValue;
137     }
138
139     public Mode getMode() {
140         return Mode.fromValue(modeValue);
141     }
142
143     public Integer getModifierValue() {
144         return modifierValue;
145     }
146
147     public void setModifierValue(Integer modifierValue) {
148         this.modifierValue = modifierValue;
149     }
150
151     public Modifier getModifier() {
152         return Modifier.fromValue(modifierValue);
153     }
154
155     public Integer getNavigationModeValue() {
156         return navigationModeValue;
157     }
158
159     public void setNavigationModeValue(Integer navigationMode) {
160         this.navigationModeValue = navigationMode;
161     }
162
163     public NavigationMode getNavigationMode() {
164         return NavigationMode.fromValue(navigationModeValue);
165     }
166
167     public Integer getSpotWidth() {
168         return spotWidth;
169     }
170
171     public void setSpotWidth(Integer spotWidth) {
172         this.spotWidth = spotWidth;
173     }
174
175     public Integer getSpotHeight() {
176         return spotHeight;
177     }
178
179     public void setSpotHeight(Integer spotHeight) {
180         this.spotHeight = spotHeight;
181     }
182 }