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;
15 import org.openhab.binding.jeelink.internal.Reading;
18 * Reading of sensors directly connected to a LGW.
20 * @author Volker Bier - Initial contribution
22 public class LgwReading implements Reading {
23 private String sensorId;
25 private Integer humidity;
26 private Integer pressure;
28 public LgwReading(int sensorId, Float temp, Integer humidity, Integer pressure) {
29 this.sensorId = String.valueOf(sensorId);
31 this.humidity = humidity;
32 this.pressure = pressure;
36 public String getSensorId() {
40 public Float getTemperature() {
44 public Integer getHumidity() {
48 public Integer getPressure() {
52 public boolean hasPressure() {
53 return pressure != null;
56 public boolean hasHumidity() {
57 return humidity != null;
60 public boolean hasTemperature() {
65 public String toString() {
66 return "sensorId=" + sensorId + ": temp=" + temp + (hasHumidity() ? ", hum=" + humidity : "")
67 + (hasPressure() ? ", pressure=" + pressure : "");