]> git.basschouten.com Git - openhab-addons.git/blob
51b4278dd96af1131e0871e604670f7ef0296384
[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.seneye.internal;
14
15 import org.openhab.core.library.types.DateTimeType;
16
17 /**
18  * The Status of the seneye device
19  *
20  * @author Niko Tanghe - Initial contribution
21  */
22
23 public class SeneyeStatus {
24     public String disconnected;
25     public String slide_serial;
26     public String slide_expires;
27     public String out_of_water;
28     public String wrong_slide;
29     public String last_experiment;
30
31     public String getLast_experimentDate() {
32         return getTickAsDate(last_experiment);
33     }
34
35     public String getSlide_expiresDate() {
36         return getTickAsDate(slide_expires);
37     }
38
39     private String getTickAsDate(String tick) {
40         return new java.text.SimpleDateFormat(DateTimeType.DATE_PATTERN_WITH_TZ_AND_MS_ISO)
41                 .format(new java.util.Date(Long.parseLong(tick) * 1000));
42     }
43
44     public String getWrong_slideString() {
45         return wrong_slide;
46     }
47
48     public String getSlide_serialString() {
49         return slide_serial;
50     }
51
52     public String getOut_of_waterString() {
53         return out_of_water;
54     }
55
56     public String getDisconnectedString() {
57         return disconnected;
58     }
59 }