]> git.basschouten.com Git - openhab-addons.git/blob
29f4b763bb214bb105441ebcf369ddb6a2a88674
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.solarwatt.internal.domain.model;
14
15 import static org.openhab.binding.solarwatt.internal.SolarwattBindingConstants.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.solarwatt.internal.domain.dto.DeviceDTO;
19
20 /**
21  * Base class for a wallbox.
22  *
23  * This fields have been identified to exist:
24  * com.kiwigrid.devices.evstation.EVStation=[
25  * PowerACOutMax,
26  * PowerACIn,
27  * VoltageACL1,
28  * VoltageACL2,
29  * VoltageACL3,
30  * WorkACOut,
31  * ConnectivityStatus,
32  * StateOfChargeMinimum,
33  * WorkACInLimitSession,
34  * WorkCharge,
35  * PowerACOut,
36  * PowerACOutLimit,
37  * AvailableModes,
38  * PowerACInMax,
39  * StateOfCharge,
40  * PowerACInLimit,
41  * CurrentACInLimit,
42  * StateInfo,
43  * ModeStation,
44  * VehicleId,
45  * CurrentACInMinimum,
46  * WorkCapacity,
47  * WorkACInSession,
48  * UserId,
49  * TemperatureBattery,
50  * WorkACIn,
51  * CurrentACInL1,
52  * CurrentACInL3,
53  * PowerACInMin,
54  * CurrentACInL2
55  * ]
56  *
57  * @author Sven Carstens - Initial contribution
58  */
59 @NonNullByDefault
60 public class EVStation extends Device {
61     public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.evstation.EVStation";
62
63     public EVStation(DeviceDTO deviceDTO) {
64         super(deviceDTO);
65     }
66
67     @Override
68     public void update(DeviceDTO deviceDTO) {
69         super.update(deviceDTO);
70
71         this.addStringState(CHANNEL_CONNECTIVITY_STATUS, deviceDTO);
72         this.addStringState(CHANNEL_MODE_STATION, deviceDTO);
73         this.addWattQuantity(CHANNEL_POWER_AC_IN, deviceDTO);
74         this.addWattHourQuantity(CHANNEL_WORK_AC_IN, deviceDTO);
75         this.addWattHourQuantity(CHANNEL_WORK_AC_IN_SESSION, deviceDTO);
76     }
77
78     @Override
79     protected String getSolarWattLabel() {
80         return "EVStation";
81     }
82 }