Skip to content

Commit

Permalink
apply i18n, comments, and tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: AndrewFG <[email protected]>
  • Loading branch information
andrewfg committed Nov 26, 2024
1 parent 892d53b commit 2c6c8f1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public UoM(Unit<?> units, float divisor) {
new AbstractMap.SimpleEntry<String, UoM>("inverter-fan-speed", new UoM(Units.PERCENT, 1)),

/*
* ============== CHANNELS ADDED IN ISSUE #99999 ==============
* ============== CHANNELS ADDED IN PR #17810 ==============
*/

// DC electric data for strings #3 and #4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public static String getFieldName(String channelId) {

// solar DC pv energy
public @Nullable @SerializedName(value = "epvtoday") Integer pv_energy_today;
public @Nullable @SerializedName(value = "epv1today", alternate = { "epv1tod", "epv1today " }) Integer pv1_energy_today;
public @Nullable @SerializedName(value = "epv1today", alternate = { "epv1tod", "epv1today " }) Integer pv1_energy_today; // alternate intentionally has trailing space
public @Nullable @SerializedName(value = "epv2today", alternate = { "epv2tod" }) Integer pv2_energy_today;

public @Nullable @SerializedName(value = "epvtotal", alternate = { "epvtotal " }) Integer pv_energy_total;
public @Nullable @SerializedName(value = "epvtotal", alternate = { "epvtotal " }) Integer pv_energy_total; // alternate intentionally has trailing space
public @Nullable @SerializedName(value = "epv1total", alternate = { "epv1tot" }) Integer pv1_energy_total;
public @Nullable @SerializedName(value = "epv2total", alternate = { "epv2tot" }) Integer pv2_energy_total;

Expand Down Expand Up @@ -203,7 +203,7 @@ public static String getFieldName(String channelId) {
public @Nullable @SerializedName(value = "invfanspeed") Integer inverter_fan_speed;

/*
* ============== CHANNELS ADDED IN PR #99999 ==============
* ============== CHANNELS ADDED IN PR #17810 ==============
*/

// DC electric data for strings #3 and #4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ thing-type.growatt.inverter.channel.discharge-power.label = Discharge Power
thing-type.growatt.inverter.channel.discharge-power.description = Discharge power from battery.
thing-type.growatt.inverter.channel.discharge-va.label = Discharge VA
thing-type.growatt.inverter.channel.discharge-va.description = Discharge VA from battery.
thing-type.growatt.inverter.channel.eps-current-r.label = EPS Current #R
thing-type.growatt.inverter.channel.eps-current-r.description = Emergency Power Supply current (phase #R).
thing-type.growatt.inverter.channel.eps-current-s.label = EPS Current #S
thing-type.growatt.inverter.channel.eps-current-s.description = Emergency Power Supply current (phase #S).
thing-type.growatt.inverter.channel.eps-current-t.label = EPS Current #T
thing-type.growatt.inverter.channel.eps-current-t.description = Emergency Power Supply current (phase #T).
thing-type.growatt.inverter.channel.eps-power.label = EPS Power
thing-type.growatt.inverter.channel.eps-power.description = Total Emergency Power Supply power.
thing-type.growatt.inverter.channel.eps-power-r.label = EPS Power #R
thing-type.growatt.inverter.channel.eps-power-r.description = Emergency Power Supply power (phase #R).
thing-type.growatt.inverter.channel.eps-power-s.label = EPS Power #S
thing-type.growatt.inverter.channel.eps-power-s.description = Emergency Power Supply power (phase #S).
thing-type.growatt.inverter.channel.eps-power-t.label = EPS Power #T
thing-type.growatt.inverter.channel.eps-power-t.description = Emergency Power Supply power (phase #T).
thing-type.growatt.inverter.channel.eps-voltage-r.label = EPS Voltage #R
thing-type.growatt.inverter.channel.eps-voltage-r.description = Emergency Power Supply voltage (phase #R).
thing-type.growatt.inverter.channel.eps-voltage-s.label = EPS Voltage #S
thing-type.growatt.inverter.channel.eps-voltage-s.description = Emergency Power Supply voltage (phase #S).
thing-type.growatt.inverter.channel.eps-voltage-t.label = EPS Voltage #T
thing-type.growatt.inverter.channel.eps-voltage-t.description = Emergency Power Supply voltage (phase #T).
thing-type.growatt.inverter.channel.erac-today.label = Reactive Energy Today
thing-type.growatt.inverter.channel.erac-today.description = Reactive energy supplied today.
thing-type.growatt.inverter.channel.erac-total.label = Total Reactive Energy
Expand Down Expand Up @@ -137,6 +157,8 @@ thing-type.growatt.inverter.channel.n-bus-voltage.label = N Bus Voltage
thing-type.growatt.inverter.channel.n-bus-voltage.description = N Bus voltage.
thing-type.growatt.inverter.channel.p-bus-voltage.label = P Bus Voltage
thing-type.growatt.inverter.channel.p-bus-voltage.description = P Bus voltage.
thing-type.growatt.inverter.channel.power-factor.label = Power Factor
thing-type.growatt.inverter.channel.power-factor.description = Electrical power factor
thing-type.growatt.inverter.channel.pv-boost-temperature.label = Boost Temperature
thing-type.growatt.inverter.channel.pv-boost-temperature.description = Boost temperature.
thing-type.growatt.inverter.channel.pv-energy-today.label = DC Energy Today
Expand Down Expand Up @@ -171,6 +193,22 @@ thing-type.growatt.inverter.channel.pv2-temperature.label = Solar Panel Temperat
thing-type.growatt.inverter.channel.pv2-temperature.description = Temperature of the solar panels (string #2).
thing-type.growatt.inverter.channel.pv2-voltage.label = String #2 Voltage
thing-type.growatt.inverter.channel.pv2-voltage.description = Voltage from solar panel string #2.
thing-type.growatt.inverter.channel.pv3-current.label = String #3 Current
thing-type.growatt.inverter.channel.pv3-current.description = Current from solar panel string #3.
thing-type.growatt.inverter.channel.pv3-energy-today.label = DC Energy #3 Today
thing-type.growatt.inverter.channel.pv3-energy-today.description = Solar DC energy collected by string #3.
thing-type.growatt.inverter.channel.pv3-energy-total.label = DC Energy #3 Total
thing-type.growatt.inverter.channel.pv3-energy-total.description = Total solar DC energy collected by string #3.
thing-type.growatt.inverter.channel.pv3-power.label = String #3 Power
thing-type.growatt.inverter.channel.pv3-power.description = Power from solar panel string #3.
thing-type.growatt.inverter.channel.pv3-voltage.label = String #3 Voltage
thing-type.growatt.inverter.channel.pv3-voltage.description = Voltage from solar panel string #3.
thing-type.growatt.inverter.channel.pv4-current.label = String #4 Current
thing-type.growatt.inverter.channel.pv4-current.description = Current from solar panel string #4.
thing-type.growatt.inverter.channel.pv4-power.label = String #4 Power
thing-type.growatt.inverter.channel.pv4-power.description = Power from solar panel string #4.
thing-type.growatt.inverter.channel.pv4-voltage.label = String #4 Voltage
thing-type.growatt.inverter.channel.pv4-voltage.description = Voltage from solar panel string #4.
thing-type.growatt.inverter.channel.rac.label = Reactive Power
thing-type.growatt.inverter.channel.rac.description = Reactive power output.
thing-type.growatt.inverter.channel.sp-bus-voltage.label = SP Bus Voltage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
<description>Inverter fan speed.</description>
</channel>

<!-- ============== CHANNELS ADDED IN PR #99999 ============== -->
<!-- ============== CHANNELS ADDED IN PR #17810 ============== -->

<!-- DC electric data for strings #3 and #4 -->
<channel id="pv3-voltage" typeId="advanced-electric-voltage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</add-channel>
</instruction-set>

<!-- ============== CHANNELS ADDED IN PR #99999 ============== -->
<!-- ============== CHANNELS ADDED IN PR #17810 ============== -->
<instruction-set targetVersion="2">
<!-- DC electric data for strings #3 and #4 -->
<add-channel id="pv3-voltage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ private void testJsonFieldsMappedToDto(String fileName) throws FileNotFoundExcep
String json = load(fileName);
JsonParser.parseString(json).getAsJsonObject().get("values").getAsJsonObject().entrySet().forEach(e -> {
String key = e.getKey();
if (GrowattChannels.UNUSED_FIELDS.containsKey(fileName)
&& !Objects.requireNonNull(GrowattChannels.UNUSED_FIELDS.get(fileName)).contains(key)) {
assertTrue(GrowattChannels.UNUSED_FIELDS.containsKey(fileName));
if (!Objects.requireNonNull(GrowattChannels.UNUSED_FIELDS.get(fileName)).contains(key)) {
JsonObject testJsonObject = new JsonObject();
testJsonObject.add(key, e.getValue());
GrottValues testDto = gson.fromJson(testJsonObject, GrottValues.class);
Expand Down

0 comments on commit 2c6c8f1

Please sign in to comment.