Feature: Allow configuring time range for price comparison average - #404
Open
spyro2000 wants to merge 14 commits into
Open
Feature: Allow configuring time range for price comparison average#404spyro2000 wants to merge 14 commits into
spyro2000 wants to merge 14 commits into
Conversation
ledermann
reviewed
Dec 16, 2025
ledermann
reviewed
Dec 16, 2025
added 9 commits
December 16, 2025 17:35
…e (without Rakefile)
ledermann
reviewed
Dec 17, 2025
ledermann
reviewed
Dec 17, 2025
Member
There was a problem hiding this comment.
Are these changes required? I prefer not to change this file.
ledermann
reviewed
Dec 17, 2025
| gem 'timecop' | ||
|
|
||
| # Used for interacting with C libraries (moved out of the default standard library in Ruby 3.4) | ||
| gem 'fiddle' |
Member
There was a problem hiding this comment.
Is this really required on Windows? On MacOS and Linux, it is not.
Maybe we should write:
gem 'fiddle', platforms: :windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue where the 24-hour average price is dragged down by low prices in the following night (common in winter), preventing the charger from recognizing the current night's prices as "cheap".
It introduces two new configuration variables:
If these are set (e.g., to 6 and 22), the system will calculate the reference "average price" using only the prices within that time window (the daytime). This higher daytime average makes the current night's prices appear cheaper by comparison, triggering the charge.