]> git.basschouten.com Git - openhab-addons.git/blob
3bf1faa8c8f0916903738c5fa7bb710737dda81f
[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.paradoxalarm.internal.model;
14
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 /**
19  * The {@link Zone} Paradox zone.
20  * ID is always numeric (1-192 for Evo192)
21  * States are taken from cached RAM memory map and parsed.
22  *
23  * @author Konstantin Polihronov - Initial contribution
24  */
25 public class Zone extends Entity {
26
27     private final Logger logger = LoggerFactory.getLogger(Zone.class);
28
29     private ZoneState zoneState;
30
31     public Zone(ParadoxPanel panel, int id, String label) {
32         super(panel, id, label);
33     }
34
35     public ZoneState getZoneState() {
36         return zoneState;
37     }
38
39     public void setZoneState(ZoneState zoneState) {
40         this.zoneState = zoneState;
41         logger.debug("Zone {} state updated to:\tOpened: {}, Tampered: {}, LowBattery: {}", getLabel(),
42                 zoneState.isOpened(), zoneState.isTampered(), zoneState.hasLowBattery());
43     }
44 }