2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.solax.internal.local;
15 import static org.junit.jupiter.api.Assertions.assertEquals;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.solax.internal.model.InverterType;
19 import org.openhab.binding.solax.internal.model.local.LocalInverterData;
22 * The {@link TestX1BoostAirMiniDataParser} Simple test that tests for proper parsing against a real data from the
25 * @author Konstantin Polihronov - Initial contribution
28 public class TestX1BoostAirMiniDataParser extends AbstractParserTest {
30 private static final String RAW_DATA = """
36 2263,7,128,1519,0,9,0,138,0,5000,
37 2,15569,0,7,0,0,0,0,0,0,
38 0,0,0,0,0,0,0,0,0,0,
39 0,0,0,0,0,0,0,0,0,13,
40 0,4071,0,3456,0,0,0,0,0,0,
41 0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
43 Information:[1.500,4,XM3A15IA669518,8,2.27,0.00,1.43,0.00,0.00,1]}
47 protected String getRawData() {
52 protected void assertParserSpecific(LocalInverterData data) {
53 assertEquals("SR***", data.getWifiSerial());
54 assertEquals("3.006.04", data.getWifiVersion());
56 assertEquals(226.3, data.getInverterVoltage()); // [0]
57 assertEquals(0.7, data.getInverterCurrent()); // [1]
58 assertEquals(128, data.getInverterOutputPower()); // [2]
60 assertEquals(151.9, data.getPV1Voltage()); // [3]
61 assertEquals(0, data.getPV2Voltage()); // [4]
62 assertEquals(0.9, data.getPV1Current()); // [5]
63 assertEquals(0, data.getPV2Current()); // [6]
64 assertEquals(138, data.getPV1Power()); // [7]
65 assertEquals(0, data.getPV2Power()); // [8]
67 assertEquals(50, data.getInverterFrequency()); // [9]
69 assertEquals(1556.9, data.getTotalEnergy()); // [11]
70 assertEquals(0.7, data.getTodayEnergy()); // [13]
72 assertEquals(346, data.getPowerUsage()); // [43]
76 protected InverterType getInverterType() {
77 return InverterType.X1_BOOST_AIR_MINI;