]> git.basschouten.com Git - openhab-addons.git/blob
a0a52464457445ebbc862f669249bfcb82f155ea
[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.mynice.internal.xml.dto;
14
15 import com.thoughtworks.xstream.annotations.XStreamAlias;
16
17 /**
18  *
19  * @author GaĆ«l L'hopital - Initial contribution
20  */
21 @XStreamAlias("Properties")
22 public class Properties {
23     public enum DoorStatus {
24         OPEN(false),
25         CLOSED(false),
26         OPENING(true),
27         CLOSING(true),
28         STOPPED(false);
29
30         public final boolean moving;
31
32         DoorStatus(boolean moving) {
33             this.moving = moving;
34         }
35     }
36
37     @XStreamAlias("DoorStatus")
38     private String doorStatus;
39     @XStreamAlias("Obstruct")
40     private String obstruct;
41     @XStreamAlias("T4_allowed")
42     public Property t4allowed;
43
44     public boolean obstructed() {
45         return "1".equals(obstruct);
46     }
47
48     public DoorStatus status() {
49         return DoorStatus.valueOf(doorStatus.toUpperCase());
50     }
51 }