2 * Copyright (c) 2010-2021 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.hydrawise.internal.api.model;
15 import com.google.gson.annotations.SerializedName;
18 * The {@link Relay} class models the Relay response message
20 * @author Dan Cunningham - Initial contribution
24 public Integer relayId;
32 public String lastwater;
38 @SerializedName("run")
39 public String runTime;
41 @SerializedName("run_seconds")
42 public Integer runTimeSeconds;
44 public String nicetime;
49 * Returns back the actual relay number when multiple controllers are chained.
53 public int getRelayNumber() {
54 int quotient = relay / 100;
55 return (relay - (quotient * 100)) + (quotient * 12);