]> git.basschouten.com Git - openhab-addons.git/blob
4b680b609fc356aa46358b3ea385e788d9905226
[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.local.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.local.LocalConnectRawDataBean;
21 import org.openhab.binding.solax.internal.model.local.LocalInverterData;
22 import org.openhab.binding.solax.internal.model.local.X1BoostAirMiniInverterData;
23
24 /**
25  * The {@link X1BoostAirMiniDataParser} is the implementation that parses raw data into a LocalInverterData for the
26  * X1 Mini / X1 Air Mini or X1 Boost Mini inverter.
27  *
28  * @author Konstantin Polihronov - Initial contribution
29  */
30 @NonNullByDefault
31 public class X1BoostAirMiniDataParser implements RawDataParser {
32
33     private static final Set<String> X1_BOOST_AIR_MINI_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_TIMESTAMP, CHANNEL_RAW_DATA, CHANNEL_INVERTER_OUTPUT_POWER,
37             CHANNEL_INVERTER_OUTPUT_CURRENT, CHANNEL_INVERTER_OUTPUT_VOLTAGE, CHANNEL_INVERTER_OUTPUT_FREQUENCY,
38             CHANNEL_TOTAL_ENERGY, CHANNEL_TODAY_ENERGY, CHANNEL_POWER_USAGE);
39
40     @Override
41     public LocalInverterData getData(LocalConnectRawDataBean bean) {
42         return new X1BoostAirMiniInverterData(bean);
43     }
44
45     @Override
46     public Set<String> getSupportedChannels() {
47         return X1_BOOST_AIR_MINI_SUPPORTED_CHANNELS;
48     }
49 }