]> git.basschouten.com Git - openhab-addons.git/blob
902efaa6c310f383c0f9dd612da36c7be8121380
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.powermax.internal.state;
14
15 /**
16  * A class to store the state of a zone
17  *
18  * @author Laurent Garnier - Initial contribution
19  */
20 public class PowermaxZoneState {
21
22     private Boolean tripped;
23     private Long lastTripped;
24     private Boolean lowBattery;
25     private Boolean bypassed;
26     private Boolean armed;
27
28     public PowermaxZoneState() {
29         tripped = null;
30         lastTripped = null;
31         lowBattery = null;
32         bypassed = null;
33         armed = null;
34     }
35
36     public Boolean isTripped() {
37         return tripped;
38     }
39
40     public void setTripped(Boolean tripped) {
41         this.tripped = tripped;
42     }
43
44     public Long getLastTripped() {
45         return lastTripped;
46     }
47
48     public void setLastTripped(Long lastTripped) {
49         this.lastTripped = lastTripped;
50     }
51
52     public boolean isLastTripBeforeTime(long refTime) {
53         return isTripped() == Boolean.TRUE && getLastTripped() != null && getLastTripped() < refTime;
54     }
55
56     public Boolean isLowBattery() {
57         return lowBattery;
58     }
59
60     public void setLowBattery(Boolean lowBattery) {
61         this.lowBattery = lowBattery;
62     }
63
64     public Boolean isBypassed() {
65         return bypassed;
66     }
67
68     public void setBypassed(Boolean bypassed) {
69         this.bypassed = bypassed;
70     }
71
72     public Boolean isArmed() {
73         return armed;
74     }
75
76     public void setArmed(Boolean armed) {
77         this.armed = armed;
78     }
79 }