Skip to content

Commit

Permalink
openhab#10413 camelCaserizeTheChannelNames
Browse files Browse the repository at this point in the history
Signed-off-by: Jamie Townsend <jamie_townsend@hotmail.com>
  • Loading branch information
jamietownsend committed Dec 15, 2021
1 parent f69440b commit 623540b
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@
public enum SolarMaxChannel {

// CHANNEL_UPDATE_VALUES_FROM_DEVICE("UpdateValuesFromDevice"),
CHANNEL_LAST_UPDATED("LastUpdated"), //
CHANNEL_LAST_UPDATED("lastUpdated"), //
// CHANNEL_DEVICE_ADDRESS(SolarMaxCommandKey.DeviceAddress.name()),
CHANNEL_SOFTWARE_VERSION(SolarMaxCommandKey.SoftwareVersion.name()),
CHANNEL_BUILD_NUMBER(SolarMaxCommandKey.BuildNumber.name()),
CHANNEL_STARTUPS(SolarMaxCommandKey.Startups.name()),
CHANNEL_AC_PHASE1_CURRENT(SolarMaxCommandKey.AcPhase1Current.name()),
CHANNEL_AC_PHASE2_CURRENT(SolarMaxCommandKey.AcPhase2Current.name()),
CHANNEL_AC_PHASE3_CURRENT(SolarMaxCommandKey.AcPhase3Current.name()),
CHANNEL_ENERGY_GENERATED_TODAY(SolarMaxCommandKey.EnergyGeneratedToday.name()),
CHANNEL_ENERGY_GENERATED_TOTAL(SolarMaxCommandKey.EnergyGeneratedTotal.name()),
CHANNEL_OPERATING_HOURS(SolarMaxCommandKey.OperatingHours.name()),
CHANNEL_ENERGY_GENERATED_YESTERDAY(SolarMaxCommandKey.EnergyGeneratedYesterday.name()),
CHANNEL_ENERGY_GENERATED_LAST_MONTH(SolarMaxCommandKey.EnergyGeneratedLastMonth.name()),
CHANNEL_ENERGY_GENERATED_LAST_YEAR(SolarMaxCommandKey.EnergyGeneratedLastYear.name()),
CHANNEL_ENERGY_GENERATED_THIS_MONTH(SolarMaxCommandKey.EnergyGeneratedThisMonth.name()),
CHANNEL_ENERGY_GENERATED_THIS_YEAR(SolarMaxCommandKey.EnergyGeneratedThisYear.name()),
CHANNEL_CURRENT_POWER_GENERATED(SolarMaxCommandKey.CurrentPowerGenerated.name()),
CHANNEL_AC_FREQUENCY(SolarMaxCommandKey.AcFrequency.name()),
CHANNEL_AC_PHASE1_VOLTAGE(SolarMaxCommandKey.AcPhase1Voltage.name()),
CHANNEL_AC_PHASE2_VOLTAGE(SolarMaxCommandKey.AcPhase2Voltage.name()),
CHANNEL_AC_PHASE3_VOLTAGE(SolarMaxCommandKey.AcPhase3Voltage.name()),
CHANNEL_HEAT_SINK_TEMPERATUR(SolarMaxCommandKey.HeatSinkTemperature.name())
CHANNEL_SOFTWARE_VERSION(SolarMaxCommandKey.softwareVersion.name()),
CHANNEL_BUILD_NUMBER(SolarMaxCommandKey.buildNumber.name()),
CHANNEL_STARTUPS(SolarMaxCommandKey.startups.name()),
CHANNEL_AC_PHASE1_CURRENT(SolarMaxCommandKey.acPhase1Current.name()),
CHANNEL_AC_PHASE2_CURRENT(SolarMaxCommandKey.acPhase2Current.name()),
CHANNEL_AC_PHASE3_CURRENT(SolarMaxCommandKey.acPhase3Current.name()),
CHANNEL_ENERGY_GENERATED_TODAY(SolarMaxCommandKey.energyGeneratedToday.name()),
CHANNEL_ENERGY_GENERATED_TOTAL(SolarMaxCommandKey.energyGeneratedTotal.name()),
CHANNEL_OPERATING_HOURS(SolarMaxCommandKey.operatingHours.name()),
CHANNEL_ENERGY_GENERATED_YESTERDAY(SolarMaxCommandKey.energyGeneratedYesterday.name()),
CHANNEL_ENERGY_GENERATED_LAST_MONTH(SolarMaxCommandKey.energyGeneratedLastMonth.name()),
CHANNEL_ENERGY_GENERATED_LAST_YEAR(SolarMaxCommandKey.energyGeneratedLastYear.name()),
CHANNEL_ENERGY_GENERATED_THIS_MONTH(SolarMaxCommandKey.energyGeneratedThisMonth.name()),
CHANNEL_ENERGY_GENERATED_THIS_YEAR(SolarMaxCommandKey.energyGeneratedThisYear.name()),
CHANNEL_CURRENT_POWER_GENERATED(SolarMaxCommandKey.currentPowerGenerated.name()),
CHANNEL_AC_FREQUENCY(SolarMaxCommandKey.acFrequency.name()),
CHANNEL_AC_PHASE1_VOLTAGE(SolarMaxCommandKey.acPhase1Voltage.name()),
CHANNEL_AC_PHASE2_VOLTAGE(SolarMaxCommandKey.acPhase2Voltage.name()),
CHANNEL_AC_PHASE3_VOLTAGE(SolarMaxCommandKey.acPhase3Voltage.name()),
CHANNEL_HEAT_SINK_TEMPERATUR(SolarMaxCommandKey.heatSinkTemperature.name())

;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public enum SolarMaxCommandKey {
// Valid commands which returned a non-null value during testing
// DeviceAddress("ADR"), // device number - only used if the devices are linked serially
// UNKNOWN_AMM("AMM"), //
BuildNumber("BDN"), //
Startups("CAC"), //
buildNumber("BDN"), //
startups("CAC"), //
// UNKNOWN_CID("CID"), //
// UNKNOWN_CPG("CPG"), //
// UNKNOWN_CPL("CPL"), //
Expand All @@ -44,26 +44,26 @@ public enum SolarMaxCommandKey {
// UNKNOWN_IEE("IEE"), //
// UNKNOWN_IEM("IEM"), //
// UNKNOWN_ILM("ILM"), //
AcPhase1Current("IL1"), //
AcPhase2Current("IL2"), //
AcPhase3Current("IL3"), //
acPhase1Current("IL1"), //
acPhase2Current("IL2"), //
acPhase3Current("IL3"), //
// UNKNOWN_IP4("IP4"), //
// UNKNOWN_ISL("ISL"), //
// UNKNOWN_ITS("ITS"), //
EnergyGeneratedToday("KDY"), //
energyGeneratedToday("KDY"), //
// UNKNOWN_KFS("KFS"), //
OperatingHours("KHR"), //
operatingHours("KHR"), //
// UNKNOWN_KHS("KHS"), //
EnergyGeneratedYesterday("KLD"), //
EnergyGeneratedLastMonth("KLM"), //
EnergyGeneratedLastYear("KLY"), //
EnergyGeneratedThisMonth("KMT"), //
energyGeneratedYesterday("KLD"), //
energyGeneratedLastMonth("KLM"), //
energyGeneratedLastYear("KLY"), //
energyGeneratedThisMonth("KMT"), //
// UNKNOWN_KTS("KTS"), //
EnergyGeneratedTotal("KT0"), //
EnergyGeneratedThisYear("KYR"), //
energyGeneratedTotal("KT0"), //
energyGeneratedThisYear("KYR"), //
// Language("LAN"), //
// MacAddress("MAC"), //
CurrentPowerGenerated("PAC"), //
currentPowerGenerated("PAC"), //
// UNKNOWN_PAE("PAE"), //
// UNKNOWN_PAM("PAM"), //
// UNKNOWN_PDA("PDA"), //
Expand Down Expand Up @@ -96,15 +96,15 @@ public enum SolarMaxCommandKey {
// UNKNOWN_SPS("SPS"), //
// UNKNOWN_SRD("SRD"), //
// UNKNOWN_SRS("SRS"), //
SoftwareVersion("SWV"), //
softwareVersion("SWV"), //
// OperatingState("SYS"), //
// UNKNOWN_TCP("TCP"), // probably port number (12345)
// UNKNOWN_TI1("TI1"), //
HeatSinkTemperature("TKK"), //
heatSinkTemperature("TKK"), //
// UNKNOWN_TL1("TL1"), //
// UNKNOWN_TL3("TL3"), //
// UNKNOWN_TND("TND"), //
AcFrequency("TNF"), //
acFrequency("TNF"), //
// UNKNOWN_TNH("TNH"), //
// UNKNOWN_TNL("TNL"), //
// UNKNOWN_TP1("TP1"), //
Expand All @@ -121,9 +121,9 @@ public enum SolarMaxCommandKey {
// UNKNOWN_UI3("UI3"), //
// UNKNOWN_ULH("ULH"), //
// UNKNOWN_ULL("ULL"), //
AcPhase1Voltage("UL1"), //
AcPhase2Voltage("UL2"), //
AcPhase3Voltage("UL3"), //
acPhase1Voltage("UL1"), //
acPhase2Voltage("UL2"), //
acPhase3Voltage("UL3"), //
// UNKNOWN_UMX("UMX"), //
// UNKNOWN_UM1("UM1"), //
// UNKNOWN_UM2("UM2"), //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,64 +42,64 @@ public boolean has(SolarMaxCommandKey key) {

public State get(SolarMaxCommandKey key) {
switch (key) {
case SoftwareVersion:
case softwareVersion:
return getSoftwareVersion();

case BuildNumber:
case buildNumber:
return getBuildNumber();

case Startups:
case startups:
return getStartups();

case AcPhase1Current:
case acPhase1Current:
return getAcPhase1Current();

case AcPhase2Current:
case acPhase2Current:
return getAcPhase2Current();

case AcPhase3Current:
case acPhase3Current:
return getAcPhase3Current();

case EnergyGeneratedToday:
case energyGeneratedToday:
return getEnergyGeneratedToday();

case EnergyGeneratedTotal:
case energyGeneratedTotal:
return getEnergyGeneratedTotal();

case OperatingHours:
case operatingHours:
return getOperatingHours();

case EnergyGeneratedYesterday:
case energyGeneratedYesterday:
return getEnergyGeneratedYesterday();

case EnergyGeneratedLastMonth:
case energyGeneratedLastMonth:
return getEnergyGeneratedLastMonth();

case EnergyGeneratedLastYear:
case energyGeneratedLastYear:
return getEnergyGeneratedLastYear();

case EnergyGeneratedThisMonth:
case energyGeneratedThisMonth:
return getEnergyGeneratedThisMonth();

case EnergyGeneratedThisYear:
case energyGeneratedThisYear:
return getEnergyGeneratedThisYear();

case CurrentPowerGenerated:
case currentPowerGenerated:
return getCurrentPowerGenerated();

case AcFrequency:
case acFrequency:
return getAcFrequency();

case AcPhase1Voltage:
case acPhase1Voltage:
return getAcPhase1Voltage();

case AcPhase2Voltage:
case acPhase2Voltage:
return getAcPhase2Voltage();

case AcPhase3Voltage:
case acPhase3Voltage:
return getAcPhase3Voltage();

case HeatSinkTemperature:
case heatSinkTemperature:
return getHeatSinkTemperature();

default:
Expand All @@ -120,83 +120,83 @@ public void setCommunicationSuccessful(boolean communicationSuccessful) {
}

public DecimalType getSoftwareVersion() {
return getIntegerValueFrom(SolarMaxCommandKey.SoftwareVersion);
return getIntegerValueFrom(SolarMaxCommandKey.softwareVersion);
}

public DecimalType getBuildNumber() {
return getIntegerValueFrom(SolarMaxCommandKey.BuildNumber);
return getIntegerValueFrom(SolarMaxCommandKey.buildNumber);
}

public DecimalType getStartups() {
return getIntegerValueFrom(SolarMaxCommandKey.Startups);
return getIntegerValueFrom(SolarMaxCommandKey.startups);
}

public DecimalType getAcPhase1Current() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase1Current, 0.01);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase1Current, 0.01);
}

public DecimalType getAcPhase2Current() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase2Current, 0.01);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase2Current, 0.01);
}

public DecimalType getAcPhase3Current() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase3Current, 0.01);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase3Current, 0.01);
}

public DecimalType getEnergyGeneratedToday() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedToday, 100);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedToday, 100);
}

public DecimalType getEnergyGeneratedTotal() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedTotal, 1000);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedTotal, 1000);
}

public DecimalType getOperatingHours() {
return getIntegerValueFrom(SolarMaxCommandKey.OperatingHours);
return getIntegerValueFrom(SolarMaxCommandKey.operatingHours);
}

public DecimalType getEnergyGeneratedYesterday() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedYesterday, 100);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedYesterday, 100);
}

public DecimalType getEnergyGeneratedLastMonth() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedLastMonth, 1000);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedLastMonth, 1000);
}

public DecimalType getEnergyGeneratedLastYear() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedLastYear, 1000);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedLastYear, 1000);
}

public DecimalType getEnergyGeneratedThisMonth() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedThisMonth, 1000);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedThisMonth, 1000);
}

public DecimalType getEnergyGeneratedThisYear() {
return getIntegerValueFrom(SolarMaxCommandKey.EnergyGeneratedThisYear, 1000);
return getIntegerValueFrom(SolarMaxCommandKey.energyGeneratedThisYear, 1000);
}

public DecimalType getCurrentPowerGenerated() {
return getIntegerValueFrom(SolarMaxCommandKey.CurrentPowerGenerated, 0.5);
return getIntegerValueFrom(SolarMaxCommandKey.currentPowerGenerated, 0.5);
}

public DecimalType getAcFrequency() {
return getDecimalValueFrom(SolarMaxCommandKey.AcFrequency, 0.01);
return getDecimalValueFrom(SolarMaxCommandKey.acFrequency, 0.01);
}

public DecimalType getAcPhase1Voltage() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase1Voltage, 0.1);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase1Voltage, 0.1);
}

public DecimalType getAcPhase2Voltage() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase2Voltage, 0.1);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase2Voltage, 0.1);
}

public DecimalType getAcPhase3Voltage() {
return getDecimalValueFrom(SolarMaxCommandKey.AcPhase3Voltage, 0.1);
return getDecimalValueFrom(SolarMaxCommandKey.acPhase3Voltage, 0.1);
}

public DecimalType getHeatSinkTemperature() {
return getIntegerValueFrom(SolarMaxCommandKey.HeatSinkTemperature);
return getIntegerValueFrom(SolarMaxCommandKey.heatSinkTemperature);
}

private DecimalType getDecimalValueFrom(SolarMaxCommandKey solarMaxCommandKey, double multiplyByFactor) {
Expand Down
Loading

0 comments on commit 623540b

Please sign in to comment.