2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.jeelink.internal.lacrosse;
16 * Reading of a TX22 Temperature/Humidity Sensor.
18 * @author Volker Bier - Initial contribution
20 public class Tx22Reading extends LaCrosseTemperatureReading {
22 private Float windDirection;
23 private Float windSpeed;
24 private Float windGust;
25 private Integer pressure;
27 public Tx22Reading(int sensorId, int sensorType, int channel, Float temp, Integer humidity, boolean batteryNew,
28 boolean batteryLow, Integer rain, Float windDirection, Float windSpeed, Float windGust, Integer pressure) {
29 super(String.valueOf(sensorId), sensorType, channel, temp, humidity, batteryNew, batteryLow);
32 this.windDirection = windDirection;
33 this.windSpeed = windSpeed;
34 this.windGust = windGust;
35 this.pressure = pressure;
38 public Integer getRain() {
42 public Float getWindDirection() {
46 public Float getWindSpeed() {
50 public Float getWindGust() {
54 public Integer getPressure() {
58 public boolean hasWindGust() {
59 return windGust != null;
62 public boolean hasWindSpeed() {
63 return windSpeed != null;
66 public boolean hasWindDirection() {
67 return windDirection != null;
70 public boolean hasPressure() {
71 return pressure != null;
74 public boolean hasRain() {
78 public boolean hasHumidity() {
79 return getHumidity() != null;
82 public boolean hasTemperature() {
83 return getTemperature() != null;
87 public String toString() {
88 return super.toString() + " rain=" + rain + " windDirection=" + windDirection + " windSpeed=" + windSpeed
89 + " windGust=" + windGust + " pressure=" + pressure;