Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
flip555 committed Sep 19, 2023
1 parent 2793985 commit 9df09c7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-next-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
run: python3 -m pip install -r requirements.txt

- name: "Run"
run: python3 -m ruff check .
run: python3 -m ruff check . --fix
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v1.0.1"
uses: "actions/checkout@v1.0.0"

- name: "Set up Python"
uses: actions/setup-python@v4.6.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v1.0.1"
uses: "actions/checkout@v1.0.0"

- name: "Adjust version number"
shell: "bash"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.0.0"
uses: "actions/checkout@v1.0.0"

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.0.0"
uses: "actions/checkout@v1.0.0"

- name: "Run HACS validation"
uses: "hacs/action@main"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,98 +369,5 @@ def decode_fourseven(hex_string):
result.compensation_point_4_position = datai_values[90]
result.compensation_point_4_impedance = datai_values[91]

# Print the calculated values
print("Monomer High Voltage Alarm:", result.monomer_high_voltage_alarm, "V")
print("Monomer High Pressure Recovery:", result.monomer_high_pressure_recovery, "V")
print("Monomer Low Pressure Alarm:", result.monomer_low_pressure_alarm, "V")
print("Monomer Low Pressure Recovery:", result.monomer_low_pressure_recovery, "V")
print("Monomer Overvoltage Protection:", result.monomer_overvoltage_protection, "V")
print("Monomer Overvoltage Recovery:", result.monomer_overvoltage_recovery, "V")
print("Monomer Undervoltage Protection:", result.monomer_undervoltage_protection, "V")
print("Monomer Undervoltage Recovery:", result.monomer_undervoltage_recovery, "V")
print("Equalization Opening Voltage:", result.equalization_opening_voltage, "V")
print("Battery Low Voltage Forbidden Charging:", result.battery_low_voltage_forbidden_charging, "V")
print("Total Pressure High Pressure Alarm:", result.total_pressure_high_pressure_alarm, "V")
print("Total Pressure High Pressure Recovery:", result.total_pressure_high_pressure_recovery, "V")
print("Total Pressure Low Pressure Alarm:", result.total_pressure_low_pressure_alarm, "V")
print("Total Pressure Low Pressure Recovery:", result.total_pressure_low_pressure_recovery, "V")
print("Total Voltage Overvoltage Protection:", result.total_voltage_overvoltage_protection, "V")
print("Total Pressure Overpressure Recovery:", result.total_pressure_overpressure_recovery, "V")
print("Total Voltage Undervoltage Protection:", result.total_voltage_undervoltage_protection, "V")
print("Total Pressure Undervoltage Recovery:", result.total_pressure_undervoltage_recovery, "V")
print("Charging Overvoltage Protection:", result.charging_overvoltage_protection, "V")
print("Charging Overvoltage Recovery:", result.charging_overvoltage_recovery, "V")
print("Charging High Temperature Warning:", result.charging_high_temperature_warning, "°C")
print("Charging High Temperature Recovery:", result.charging_high_temperature_recovery, "°C")
print("Charging Low Temperature Warning:", result.charging_low_temperature_warning, "°C")
print("Charging Low Temperature Recovery:", result.charging_low_temperature_recovery, "°C")
print("Charging Over Temperature Protection:", result.charging_over_temperature_protection, "°C")
print("Charging Over Temperature Recovery:", result.charging_over_temperature_recovery, "°C")
print("Charging Under Temperature Protection:", result.charging_under_temperature_protection, "°C")
print("Charging Under Temperature Recovery:", result.charging_under_temperature_recovery, "°C")
print("Discharge High Temperature Warning:", result.discharge_high_temperature_warning, "°C")
print("Discharge High Temperature Recovery:", result.discharge_high_temperature_recovery, "°C")
print("Discharge Low Temperature Warning:", result.discharge_low_temperature_warning, "°C")
print("Discharge Low Temperature Recovery:", result.discharge_low_temperature_recovery, "°C")
print("Discharge Over Temperature Protection:", result.discharge_over_temperature_protection, "°C")
print("Discharge Over Temperature Recovery:", result.discharge_over_temperature_recovery, "°C")
print("Discharge Under Temperature Protection:", result.discharge_under_temperature_protection, "°C")
print("Discharge Under Temperature Recovery:", result.discharge_under_temperature_recovery, "°C")
print("Cell Low Temperature Heating:", result.cell_low_temperature_heating, "°C")
print("Cell Heating Recovery:", result.cell_heating_recovery, "°C")
print("Ambient High Temperature Alarm:", result.ambient_high_temperature_alarm, "°C")
print("Ambient High Temperature Recovery:", result.ambient_high_temperature_recovery, "°C")
print("Ambient Low Temperature Warning:", result.ambient_low_temperature_warning, "°C")
print("Ambient Low Temperature Recovery:", result.ambient_low_temperature_recovery, "°C")
print("Fan Fault:", result.fan_fault, "times")
print("Fan Fault Recovery:", result.fan_fault_recovery, "times")
print("CAN Communication Fault:", result.can_communication_fault, "times")
print("CAN Communication Fault Recovery:", result.can_communication_fault_recovery, "times")
print("MOS Short Circuit Protection:", result.mos_short_circuit_protection, "times")
print("MOS Short Circuit Protection Recovery:", result.mos_short_circuit_protection_recovery, "times")
print("Power High Temperature Recovery:", result.power_high_temperature_recovery, "°C")
print("Power Over Temperature Protection:", result.power_over_temperature_protection, "°C")
print("Power Over Temperature Recovery:", result.power_over_temperature_recovery, "°C")
print("Charging Overcurrent Warning:", result.charging_overcurrent_warning, "A")
print("Charging Overcurrent Recovery:", result.charging_overcurrent_recovery, "A")
print("Discharge Overcurrent Warning:", result.discharge_overcurrent_warning, "A")
print("Discharge Overcurrent Recovery:", result.discharge_overcurrent_recovery, "A")
print("Charge Overcurrent Protection:", result.charge_overcurrent_protection, "A")
print("Discharge Overcurrent Protection:", result.discharge_overcurrent_protection, "A")
print("Transient Overcurrent Protection:", result.transient_overcurrent_protection, "A")
print("Output Soft Start Delay:", result.output_soft_start_delay, "ms")
print("Battery Rated Capacity:", result.battery_rated_capacity, "Ah")
print("SOC:", result.soc, "Ah")
print("Cell Invalidation Differential Pressure:", result.cell_invalidation_differential_pressure, "V")
print("Cell Invalidation Recovery:", result.cell_invalidation_recovery, "V")
print("Equalization Opening Pressure Difference:", result.equalization_opening_pressure_difference, "V")
print("Equalization Closing Pressure Difference:", result.equalization_closing_pressure_difference, "V")
print("Static Equilibrium Time:", result.static_equilibrium_time, "times")
print("Battery Number in Series:", result.battery_number_in_series, "strings")
print("Charge Overcurrent Delay:", result.charge_overcurrent_delay, "s")
print("Discharge Overcurrent Delay:", result.discharge_overcurrent_delay, "s")
print("Transient Overcurrent Delay:", result.transient_overcurrent_delay, "s")
print("Overcurrent Delay Recovery:", result.overcurrent_delay_recovery, "s")
print("Overcurrent Recovery Times:", result.overcurrent_recovery_times, "times")
print("Charge Current Limit Delay:", result.charge_current_limit_delay, "min")
print("Charge Activation Delay:", result.charge_activation_delay, "min")
print("Charge Activation Interval:", result.charge_activation_interval, "times")
print("Charge Activation Times:", result.charge_activation_times, "times")
print("Work Record Interval:", result.work_record_interval, "min")
print("Standby Recording Interval:", result.standby_recording_interval, "min")
print("Standby Shutdown Delay:", result.standby_shutdown_delay, "times")
print("Remaining Capacity Alarm:", result.remaining_capacity_alarm, "%")
print("Remaining Capacity Protection:", result.remaining_capacity_protection, "%")
print("Interval Charge Capacity:", result.interval_charge_capacity, "%")
print("Cycle Cumulative Capacity:", result.cycle_cumulative_capacity, "%")
print("Connection Fault Impedance:", result.connection_fault_impedance, "mΩ")
print("Compensation Point 1 Position:", result.compensation_point_1_position, "strings")
print("Compensation Point 1 Impedance:", result.compensation_point_1_impedance, "mΩ")
print("Compensation Point 2 Position:", result.compensation_point_2_position, "strings")
print("Compensation Point 2 Impedance:", result.compensation_point_2_impedance, "mΩ")
print("Compensation Point 3 Position:", result.compensation_point_3_position, "strings")
print("Compensation Point 3 Impedance:", result.compensation_point_3_impedance, "mΩ")
print("Compensation Point 4 Position:", result.compensation_point_4_position, "strings")
print("Compensation Point 4 Impedance:", result.compensation_point_4_impedance, "mΩ")

return result

0 comments on commit 9df09c7

Please sign in to comment.