]> git.basschouten.com Git - openhab-addons.git/blob
8a05f2e8801407e9108602999458b89c62a9c1b8
[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.mybmw.internal.dto.charge;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 /**
19  * The {@link ChargingProfile} Data Transfer Object
20  *
21  * @author Bernd Weymann - Initial contribution
22  * @author Norbert Truchsess - edit and send of charge profile
23  * @author Martin Grassl - refactored to Java Bean
24  */
25 public class ChargingProfile {
26     private ChargingWindow reductionOfChargeCurrent = new ChargingWindow();
27     private String chargingMode = "";// ": "immediateCharging",
28     private String chargingPreference = "";// ": "chargingWindow",
29     private String chargingControlType = "";// ": "weeklyPlanner",
30     private List<Timer> departureTimes = new ArrayList<>();
31     private boolean climatisationOn = false;// ": false,
32     private ChargingSettings chargingSettings = new ChargingSettings();
33
34     public Timer getTimerId(int id) {
35         if (departureTimes != null) {
36             for (Timer t : departureTimes) {
37                 if (t.id == id) {
38                     return t;
39                 }
40             }
41         }
42         return new Timer();
43     }
44
45     public ChargingWindow getReductionOfChargeCurrent() {
46         return reductionOfChargeCurrent;
47     }
48
49     public String getChargingMode() {
50         return chargingMode;
51     }
52
53     public String getChargingPreference() {
54         return chargingPreference;
55     }
56
57     public String getChargingControlType() {
58         return chargingControlType;
59     }
60
61     public List<Timer> getDepartureTimes() {
62         return departureTimes;
63     }
64
65     public boolean isClimatisationOn() {
66         return climatisationOn;
67     }
68
69     public ChargingSettings getChargingSettings() {
70         return chargingSettings;
71     }
72
73     @Override
74     public String toString() {
75         return "ChargingProfile [reductionOfChargeCurrent=" + reductionOfChargeCurrent + ", chargingMode="
76                 + chargingMode + ", chargingPreference=" + chargingPreference + ", chargingControlType="
77                 + chargingControlType + ", departureTimes=" + departureTimes + ", climatisationOn=" + climatisationOn
78                 + ", chargingSettings=" + chargingSettings + "]";
79     }
80 }