]> git.basschouten.com Git - openhab-addons.git/blob
be289e1d9e0e8b0d4dbc85da586e4aa0dcec6f8a
[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.pca301;
14
15 import org.openhab.binding.jeelink.internal.Reading;
16
17 /**
18  * Reading of a PCA301 sensor.
19  *
20  * @author Volker Bier - Initial contribution
21  */
22 public class Pca301Reading implements Reading {
23     private final String sensorId;
24     private final int channel;
25     private final boolean on;
26     private final float current;
27     private final long total;
28
29     public Pca301Reading(String sensorId, int channel, boolean deviceOn, float consumptionCurrent,
30             long consumptionTotal) {
31         this.sensorId = sensorId;
32         this.channel = channel;
33         on = deviceOn;
34         current = consumptionCurrent;
35         total = consumptionTotal;
36     }
37
38     @Override
39     public String getSensorId() {
40         return sensorId;
41     }
42
43     public int getChannel() {
44         return channel;
45     }
46
47     public boolean isOn() {
48         return on;
49     }
50
51     public float getCurrent() {
52         return current;
53     }
54
55     public long getTotal() {
56         return total;
57     }
58 }