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.opensprinkler.internal;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.core.types.StateOption;
22 import com.google.gson.annotations.SerializedName;
25 * The {@link OpenSprinklerState} class holds the state and replies for an OpenSprinkler device.
27 * @author Matthew Skinner - Initial contribution
30 public class OpenSprinklerState {
31 public JcResponse jcReply = new JcResponse();
32 public JoResponse joReply = new JoResponse();
33 public JsResponse jsReply = new JsResponse();
34 public JpResponse jpReply = new JpResponse();
35 public JnResponse jnReply = new JnResponse();
36 public List<StateOption> programs = new ArrayList<>();
37 public List<StateOption> stations = new ArrayList<>();
39 public static class JsResponse {
40 public int[] sn = new int[8];
41 public int nstations = 8;
44 public static class JpResponse {
45 public int nprogs = 0;
46 public Object[] pd = {};
49 public static class JoResponse {
54 public static class JcResponse {
55 public @Nullable List<List<Integer>> ps;
56 @SerializedName(value = "sn1", alternate = "rs")
62 @SerializedName(value = "RSSI", alternate = "rssi") // json reply uses all uppercase
64 public int flcrt = -1;
68 public static class JnResponse {
69 public List<String> snames = new ArrayList<>();
70 @SerializedName(value = "ignore_rain", alternate = "ignoreRain")
71 public byte[] ignoreRain = { 0 };