Skip to content

Commit

Permalink
No need for CO2_EMISSION_FACTOR constant
Browse files Browse the repository at this point in the history
Belongs to #3290
  • Loading branch information
ledermann committed Jul 25, 2024
1 parent b360e09 commit 99b7eb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/services/calculator/range.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class Calculator::Range < Calculator::Base
CO2_EMISSION_FACTOR = Rails.application.config.x.co2_emission_factor
public_constant :CO2_EMISSION_FACTOR

def initialize(timeframe)
super()

Expand Down Expand Up @@ -112,7 +109,7 @@ def savings
def co2_reduction
return unless inverter_power

inverter_power / 1000 * CO2_EMISSION_FACTOR
inverter_power / 1000 * Rails.application.config.x.co2_emission_factor
end

def battery_savings
Expand Down
2 changes: 1 addition & 1 deletion app/services/chart_data/co2_reduction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def data
end

def co2_reduction_factor
Calculator::Range::CO2_EMISSION_FACTOR.fdiv(
Rails.application.config.x.co2_emission_factor.fdiv(
if timeframe.short?
# g per hour
24.0
Expand Down

0 comments on commit 99b7eb8

Please sign in to comment.