Skip to content

Commit

Permalink
introduced setting for including regeneration in consumption daily stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuinigeRijder committed Aug 5, 2024
1 parent c7e56eb commit 85b6149
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ use_geocode = True
use_geocode_email = True
language = en
odometer_metric = km
include_regenerate_in_consumption = False
```

Explanation of the configuration items:
Expand All @@ -220,6 +221,7 @@ Explanation of the configuration items:
- use_geocode_email: (default: True) use email to avoid abuse of address lookup
- language: (default: en) the Bluelink App is reset to English for users who have set another language in the Bluelink App in Europe when using hyundai_kia_connect_api, you can configure another language as workaround
- odometer_metric, e.g. km or mi
- include_regenerate_in_consumption, in [R3.23.0](https://github.com/ZuinigeRijder/hyundai_kia_connect_monitor/releases/tag/R3.23.0) the regeneration is taken into account for the consumption in daily stats, to better match the boardcomputer values. However, some users have better results in the old situation. Included a setting, default is the old situation before R3.23.0.

*Note: language is only implemented for Europe currently.*

Expand Down
7 changes: 6 additions & 1 deletion dailystats.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def dbg(line: str) -> bool:
parser.read(get_filepath("monitor.cfg"))
monitor_settings = dict(parser.items("monitor"))
ODO_METRIC = get(monitor_settings, "odometer_metric", "km").lower()
INCLUDE_REGENERATE_IN_CONSUMPTION = (
get(monitor_settings, "include_regenerate_in_consumption", "False").lower()
== "true"
)

# indexes to splitted monitor.dailystats.csv items
DATE = 0
Expand Down Expand Up @@ -530,7 +534,8 @@ def print_dailystats(
batterycare: int,
) -> None:
"""print stats"""
consumed = consumed + regenerated # car efficiency is including regenerated
if INCLUDE_REGENERATE_IN_CONSUMPTION:
consumed = consumed + regenerated # car efficiency is including regenerated
regenerated_perc = safe_divide(regenerated * 100, consumed)
engine_perc = safe_divide(engine * 100, consumed)
climate_perc = safe_divide(climate * 100, consumed)
Expand Down
1 change: 1 addition & 0 deletions monitor.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ use_geocode = True
use_geocode_email = True
language = en
odometer_metric = km
include_regenerate_in_consumption = False

0 comments on commit 85b6149

Please sign in to comment.