]> git.basschouten.com Git - openhab-addons.git/blob
ef5c1259cf2c478200ebaf59d0bb31145e8821c9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.tplinksmarthome.internal.model;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * Data class for getting the tp-Link Smart Plug energy state.
21  * Only getter methods as the values are set by gson based on the retrieved json.
22  *
23  * @author Hilbrand Bouwkamp - Initial contribution
24  */
25 @NonNullByDefault
26 public class GetRealtime extends ContextState {
27
28     public static class EMeter {
29         private Realtime getRealtime = new Realtime();
30
31         public Realtime getRealtime() {
32             return getRealtime;
33         }
34
35         @Override
36         public String toString() {
37             return "get_realtime:{" + getRealtime + "}";
38         }
39     }
40
41     @SerializedName(value = "emeter", alternate = "smartlife.iot.common.emeter")
42     private EMeter emeter = new EMeter();
43
44     public Realtime getRealtime() {
45         return emeter.getRealtime();
46     }
47
48     @Override
49     public String toString() {
50         return "GetRealtime {emeter:{" + emeter + "}}";
51     }
52 }