]> git.basschouten.com Git - openhab-addons.git/blob
79df517e65a71fed83eb28a586b4021a2fbe31f3
[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.satel.internal.event;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Event class describing current temperature in a zone.
19  *
20  * @author Krzysztof Goworek - Initial contribution
21  */
22 @NonNullByDefault
23 public class ZoneTemperatureEvent implements SatelEvent {
24
25     private int zoneNbr;
26     private float temperature;
27
28     /**
29      * Constructs new event class.
30      *
31      * @param zoneNbr zone number
32      * @param temperature current temperature in the zone
33      */
34     public ZoneTemperatureEvent(int zoneNbr, float temperature) {
35         this.zoneNbr = zoneNbr;
36         this.temperature = temperature;
37     }
38
39     /**
40      * @return zone number
41      */
42     public int getZoneNbr() {
43         return zoneNbr;
44     }
45
46     /**
47      * @return temperature in the zone
48      */
49     public float getTemperature() {
50         return temperature;
51     }
52
53     @Override
54     public String toString() {
55         return String.format("ZoneTemperatureEvent: zoneNbr = %d, temperature = %.1f", this.zoneNbr, this.temperature);
56     }
57 }