]> git.basschouten.com Git - openhab-addons.git/blob
aa67bc43209c62404dfe3701b55dbc688663aec1
[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.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 all inverters.
22  *
23  * This fields have been identified to exist:
24  * com.kiwigrid.devices.inverter.Inverter=[
25  * WorkACOut,
26  * PowerInstalledPeak,
27  * PowerStringDCIn,
28  * PowerACOutMax,
29  * PowerACOut,
30  * PowerACOutLimit,
31  * ACPower,
32  * PowerYieldSum
33  * ]
34  *
35  * @author Sven Carstens - Initial contribution
36  */
37 @NonNullByDefault
38 public class Inverter extends Device {
39     public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.inverter.Inverter";
40
41     public Inverter(DeviceDTO deviceDTO) {
42         super(deviceDTO);
43     }
44
45     @Override
46     public void update(DeviceDTO deviceDTO) {
47         super.update(deviceDTO);
48
49         this.addWattHourQuantity(CHANNEL_WORK_AC_OUT, deviceDTO);
50         this.addWattQuantity(CHANNEL_POWER_AC_OUT_MAX, deviceDTO);
51         this.addWattQuantity(CHANNEL_POWER_AC_OUT, deviceDTO);
52         this.addWattQuantity(CHANNEL_POWER_AC_OUT_LIMIT, deviceDTO);
53
54         this.addWattQuantity(CHANNEL_POWER_INSTALLED_PEAK, deviceDTO, true);
55     }
56
57     @Override
58     protected String getSolarWattLabel() {
59         return "Inverter";
60     }
61 }