]> git.basschouten.com Git - openhab-addons.git/blob
159ff42946fc223a765b46eb7d3cdf01c44623d8
[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.lacrosse;
14
15 import org.openhab.binding.jeelink.internal.Reading;
16
17 /**
18  * Reading of a LaCrosse Temperature Sensor.
19  *
20  * @author Volker Bier - Initial contribution
21  */
22 public class LaCrosseTemperatureReading implements Reading {
23     private String sensorId;
24     private int sensorType;
25     private int channel;
26     private Float temp;
27     private Integer humidity;
28     private boolean batteryNew;
29     private boolean batteryLow;
30
31     public LaCrosseTemperatureReading(int sensorId, int sensorType, int channel, Float temp, Integer humidity,
32             boolean batteryNew, boolean batteryLow) {
33         this(String.valueOf(sensorId), sensorType, channel, temp, humidity, batteryNew, batteryLow);
34     }
35
36     public LaCrosseTemperatureReading(String sensorId, int sensorType, int channel, Float temp, Integer humidity,
37             boolean batteryNew, boolean batteryLow) {
38         this.sensorId = sensorId;
39         this.sensorType = sensorType;
40         this.channel = channel;
41         this.temp = temp;
42         this.humidity = humidity;
43         this.batteryNew = batteryNew;
44         this.batteryLow = batteryLow;
45     }
46
47     @Override
48     public String getSensorId() {
49         return sensorId;
50     }
51
52     public int getSensorType() {
53         return sensorType;
54     }
55
56     public Float getTemperature() {
57         return temp;
58     }
59
60     public Integer getHumidity() {
61         return humidity;
62     }
63
64     public boolean isBatteryLow() {
65         return batteryLow;
66     }
67
68     @Override
69     public String toString() {
70         return "sensorId=" + sensorId + ": channel=" + channel + ", temp=" + temp + ", hum=" + humidity + ", batLow="
71                 + batteryLow + ", batNew=" + batteryNew;
72     }
73
74     public boolean isBatteryNew() {
75         return batteryNew;
76     }
77
78     public int getChannel() {
79         return channel;
80     }
81 }