]> git.basschouten.com Git - openhab-addons.git/blob
48ef1a472be8cf0f887a57fb63faf666f8adec22
[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.jeelink.internal.ec3k;
14
15 import org.openhab.binding.jeelink.internal.Reading;
16
17 /**
18  * Reading of an EC3000 sensor.
19  *
20  * @author Volker Bier - Initial contribution
21  */
22 public class Ec3kReading implements Reading {
23     private float currentWatt;
24     private float maxWatt;
25     private long consumptionTotal;
26     private long applianceTime;
27     private long sensorTime;
28     private String sensorId;
29     private int resets;
30
31     public Ec3kReading(String sensorId, float currentWatt, float maxWatt, long consumptionTotal, long applianceTime,
32             long sensorTime, int resets) {
33         this.currentWatt = currentWatt;
34         this.maxWatt = maxWatt;
35         this.consumptionTotal = consumptionTotal;
36         this.applianceTime = applianceTime;
37         this.sensorTime = sensorTime;
38         this.sensorId = sensorId;
39         this.resets = resets;
40     }
41
42     @Override
43     public String toString() {
44         return "sensorId=" + sensorId + ": currWatt=" + currentWatt + ", maxWatt=" + maxWatt + ", consumption="
45                 + consumptionTotal + ", applianceTime=" + applianceTime + ", sensorTime=" + sensorTime + ", resets="
46                 + resets;
47     }
48
49     public float getCurrentWatt() {
50         return currentWatt;
51     }
52
53     @Override
54     public String getSensorId() {
55         return sensorId;
56     }
57
58     public float getMaxWatt() {
59         return maxWatt;
60     }
61
62     public long getConsumptionTotal() {
63         return consumptionTotal;
64     }
65
66     public long getApplianceTime() {
67         return applianceTime;
68     }
69
70     public long getSensorTime() {
71         return sensorTime;
72     }
73
74     public int getResets() {
75         return resets;
76     }
77 }