2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.neato.internal.classes;
16 * The {@link NeatoState} is the internal class for state information from the vacuum cleaner.
18 * @author Patrik Wimnell - Initial contribution
20 public class NeatoState {
22 private Integer version;
24 private String result;
26 private RobotInfoData data;
27 private Integer state;
28 private Integer action;
29 private Cleaning cleaning;
30 private Details details;
31 private AvailableCommands availableCommands;
32 private AvailableServices availableServices;
35 public enum RobotState {
44 RobotState(int value) {
48 public static RobotState fromValue(int value) {
49 for (RobotState s : RobotState.values()) {
50 if (s.value == value) {
58 public enum RobotAction {
65 SUSPENDED_CLEANING(6),
68 RECOVERING_LOCATION(9),
74 SUSPENDED_EXPLORATION(15);
78 RobotAction(int value) {
82 public static RobotAction fromValue(int value) {
83 for (RobotAction a : RobotAction.values()) {
84 if (a.value == value) {
92 public Integer getVersion() {
96 public void setVersion(Integer version) {
97 this.version = version;
100 public String getReqId() {
104 public void setReqId(String reqId) {
108 public String getResult() {
112 public void setResult(String result) {
113 this.result = result;
116 public String getError() {
120 public void setError(String error) {
124 public RobotInfoData getData() {
128 public void setData(RobotInfoData data) {
132 public Integer getState() {
136 public RobotState getRobotState() {
137 return RobotState.fromValue(this.state);
140 public void setState(Integer state) {
144 public Integer getAction() {
148 public RobotAction getRobotAction() {
149 return RobotAction.fromValue(this.action);
152 public void setAction(Integer action) {
153 this.action = action;
156 public Cleaning getCleaning() {
160 public void setCleaning(Cleaning cleaning) {
161 this.cleaning = cleaning;
164 public Details getDetails() {
168 public void setDetails(Details details) {
169 this.details = details;
172 public AvailableCommands getAvailableCommands() {
173 return availableCommands;
176 public void setAvailableCommands(AvailableCommands availableCommands) {
177 this.availableCommands = availableCommands;
180 public AvailableServices getAvailableServices() {
181 return availableServices;
184 public void setAvailableServices(AvailableServices availableServices) {
185 this.availableServices = availableServices;
188 public Meta getMeta() {
193 public String toString() {
194 return "NeatoState{" + "version=" + version + ", reqId='" + reqId + '\'' + ", result='" + result + '\''
195 + ", error='" + error + '\'' + ", data=" + data + ", state=" + state + ", action=" + action
196 + ", cleaning=" + cleaning + ", details=" + details + ", availableCommands=" + availableCommands
197 + ", availableServices=" + availableServices + ", meta=" + meta + '}';
200 public void setMeta(Meta meta) {