]> git.basschouten.com Git - openhab-addons.git/blob
0487b4f845304fa057ad9e985e6e1faa3f403173
[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.robonect.internal.model;
14
15 /**
16  * Object holding information from the status section of the mowers status response.
17  * 
18  * @author Marco Meyer - Initial contribution
19  */
20 public class Status {
21
22     private int battery;
23     private int duration;
24     private int hours;
25     private MowerStatus status;
26     private MowerMode mode;
27     private boolean stopped;
28
29     /**
30      * @return - the battery level in percent. (0-100)
31      */
32     public int getBattery() {
33         return battery;
34     }
35
36     /**
37      * @return - The duration in seconds the mower is already in the current {@link #status}.
38      */
39     public int getDuration() {
40         return duration;
41     }
42
43     /**
44      * @return - The hours the mower was in use so far.
45      */
46     public int getHours() {
47         return hours;
48     }
49
50     /**
51      * @return - The status the mower is currently in. see {@link MowerStatus} for details.
52      */
53     public MowerStatus getStatus() {
54         return status;
55     }
56
57     /**
58      * @return - true if the mower is currentyl stopped, false otherwise.
59      */
60     public boolean isStopped() {
61         return stopped;
62     }
63
64     /**
65      * @return - The mode the mower is currently in. See {@link MowerMode} for details.
66      */
67     public MowerMode getMode() {
68         return mode;
69     }
70
71     public void setBattery(int battery) {
72         this.battery = battery;
73     }
74
75     public void setDuration(int duration) {
76         this.duration = duration;
77     }
78
79     public void setHours(int hours) {
80         this.hours = hours;
81     }
82
83     public void setStatus(MowerStatus status) {
84         this.status = status;
85     }
86
87     public void setMode(MowerMode mode) {
88         this.mode = mode;
89     }
90
91     public void setStopped(boolean stopped) {
92         this.stopped = stopped;
93     }
94 }