2 * Copyright (c) 2010-2020 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.gardena.internal.model.property;
15 import com.google.gson.annotations.SerializedName;
18 * Represents a Gardena complex property value for the irrigation control.
20 * @author Gerhard Riegler - Initial contribution
23 public class IrrigationControlWateringProperty extends BaseProperty {
24 private IrrigationControlWateringValue value = new IrrigationControlWateringValue();
26 public IrrigationControlWateringProperty(String name, int duration, int valveId) {
29 value.state = duration == 0 ? "idle" : "manual";
30 value.duration = duration;
31 value.valveId = valveId;
35 public String getValue() {
36 return String.valueOf(value.duration);
39 @SuppressWarnings("unused")
40 private class IrrigationControlWateringValue {
43 @SerializedName("valve_id")