]> git.basschouten.com Git - openhab-addons.git/blob
aa778f64762fdf50fe4f8e8eeb1dbc21e4c2e2df
[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.revolt;
14
15 import org.openhab.binding.jeelink.internal.Reading;
16
17 /**
18  * Reading of a Revolt Energy Meter sensor.
19  *
20  * @author Volker Bier - Initial contribution
21  */
22 public class RevoltReading implements Reading {
23     private int voltage;
24     private float current;
25     private int frequency;
26     private float power;
27     private float powerFact;
28     private float consumption;
29     private String sensorId;
30
31     public RevoltReading(String sensorId, int voltage, float current, int frequency, float power, float powerFactor,
32             float consumption) {
33         this.sensorId = sensorId;
34         this.voltage = voltage;
35         this.current = current;
36         this.frequency = frequency;
37         this.power = power;
38         this.powerFact = powerFactor;
39         this.consumption = consumption;
40     }
41
42     @Override
43     public String toString() {
44         return "sensorId=" + sensorId + ": voltage=" + voltage + ", current=" + current + ", frequency=" + frequency
45                 + ", power=" + power + ", powerFact=" + powerFact + ", consumption=" + consumption;
46     }
47
48     @Override
49     public String getSensorId() {
50         return sensorId;
51     }
52
53     public int getVoltage() {
54         return voltage;
55     }
56
57     public float getCurrent() {
58         return current;
59     }
60
61     public int getFrequency() {
62         return frequency;
63     }
64
65     public float getPower() {
66         return power;
67     }
68
69     public float getPowerFactor() {
70         return powerFact;
71     }
72
73     public float getConsumption() {
74         return consumption;
75     }
76 }