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.robonect.internal.model;
16 * The mower mode from the status information. Please note
17 * that EOD and JOB from {@link org.openhab.binding.robonect.internal.model.cmd.ModeCommand.Mode}
18 * are just artificial and are therfore not reported in the status information.
20 * @author Marco Meyer - Initial contribution
22 public enum MowerMode {
45 * An unknown mode. Actually this mode should never be set but is there if for some reason an unexpected value
46 * is returned from the module response.
57 * Translate the numeric mode from the JSON response into enum values.
59 * @param mode - the numeric value of the mode.
60 * @return - the enum value of the mode.
62 public static MowerMode fromMode(int mode) {
63 for (MowerMode mowerMode : MowerMode.values()) {
64 if (mowerMode.code == mode) {
72 * @return - The numeric code of the mode.
74 public int getCode() {