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.tplinksmarthome.internal.model;
15 import org.openhab.core.library.types.OnOffType;
17 import com.google.gson.annotations.Expose;
20 * Data class to set the led of a Smart Home device on or off.
21 * Only setter methods as the object is only used to send values.
23 * @author Hilbrand Bouwkamp - Initial contribution
25 public class SetLedOff extends ContextState implements HasErrorResponse {
27 public static class LedOff extends ErrorResponse {
31 public void setOff(int off) {
36 public String toString() {
37 return "off:" + off + super.toString();
41 public static class System {
43 private LedOff setLedOff = new LedOff();
46 public String toString() {
47 return "set_led_off:{" + setLedOff + "}";
52 private System system = new System();
55 public ErrorResponse getErrorResponse() {
56 return system.setLedOff;
59 public void setLed(OnOffType onOff) {
60 system.setLedOff.setOff(onOff == OnOffType.OFF ? 1 : 0);
64 public String toString() {
65 return "SetLedOff {system:{" + system + "}";