]> git.basschouten.com Git - openhab-addons.git/blob
fd68cf15e3289149f6096cf779485dac626abe56
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.solax.internal.model.parsers;
14
15 import static org.openhab.binding.solax.internal.SolaxBindingConstants.*;
16
17 import java.util.Set;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.solax.internal.connectivity.rawdata.LocalConnectRawDataBean;
21 import org.openhab.binding.solax.internal.model.InverterData;
22 import org.openhab.binding.solax.internal.model.impl.X1HybridG4InverterData;
23
24 /**
25  * The {@link SinglePhaseDataParser} is the implementation that parses raw data into a SinglePhaseInverterData for the
26  * X1 Hybrid G4 inverter.
27  *
28  * @author Konstantin Polihronov - Initial contribution
29  */
30 @NonNullByDefault
31 public class X1HybridG4DataParser implements RawDataParser {
32
33     private static final Set<String> X1_HYBRID_G4_SUPPORTED_CHANNELS = Set.of(CHANNEL_INVERTER_PV1_POWER,
34             CHANNEL_INVERTER_PV1_VOLTAGE, CHANNEL_INVERTER_PV1_CURRENT, CHANNEL_INVERTER_PV2_POWER,
35             CHANNEL_INVERTER_PV2_VOLTAGE, CHANNEL_INVERTER_PV2_CURRENT, CHANNEL_INVERTER_PV_TOTAL_POWER,
36             CHANNEL_INVERTER_PV_TOTAL_CURRENT, CHANNEL_BATTERY_POWER, CHANNEL_BATTERY_VOLTAGE, CHANNEL_BATTERY_CURRENT,
37             CHANNEL_BATTERY_TEMPERATURE, CHANNEL_BATTERY_STATE_OF_CHARGE, CHANNEL_FEED_IN_POWER, CHANNEL_TIMESTAMP,
38             CHANNEL_RAW_DATA, CHANNEL_INVERTER_OUTPUT_POWER, CHANNEL_INVERTER_OUTPUT_CURRENT,
39             CHANNEL_INVERTER_OUTPUT_VOLTAGE, CHANNEL_INVERTER_OUTPUT_FREQUENCY);
40
41     @Override
42     public InverterData getData(LocalConnectRawDataBean rawData) {
43         return new X1HybridG4InverterData(rawData);
44     }
45
46     @Override
47     public Set<String> getSupportedChannels() {
48         return X1_HYBRID_G4_SUPPORTED_CHANNELS;
49     }
50 }