Skip to content

Commit 85b6149

Browse files
committed
introduced setting for including regeneration in consumption daily stats
1 parent c7e56eb commit 85b6149

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ use_geocode = True
208208
use_geocode_email = True
209209
language = en
210210
odometer_metric = km
211+
include_regenerate_in_consumption = False
211212
```
212213

213214
Explanation of the configuration items:
@@ -220,6 +221,7 @@ Explanation of the configuration items:
220221
- use_geocode_email: (default: True) use email to avoid abuse of address lookup
221222
- 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
222223
- odometer_metric, e.g. km or mi
224+
- 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.
223225

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

dailystats.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ def dbg(line: str) -> bool:
8686
parser.read(get_filepath("monitor.cfg"))
8787
monitor_settings = dict(parser.items("monitor"))
8888
ODO_METRIC = get(monitor_settings, "odometer_metric", "km").lower()
89+
INCLUDE_REGENERATE_IN_CONSUMPTION = (
90+
get(monitor_settings, "include_regenerate_in_consumption", "False").lower()
91+
== "true"
92+
)
8993

9094
# indexes to splitted monitor.dailystats.csv items
9195
DATE = 0
@@ -530,7 +534,8 @@ def print_dailystats(
530534
batterycare: int,
531535
) -> None:
532536
"""print stats"""
533-
consumed = consumed + regenerated # car efficiency is including regenerated
537+
if INCLUDE_REGENERATE_IN_CONSUMPTION:
538+
consumed = consumed + regenerated # car efficiency is including regenerated
534539
regenerated_perc = safe_divide(regenerated * 100, consumed)
535540
engine_perc = safe_divide(engine * 100, consumed)
536541
climate_perc = safe_divide(climate * 100, consumed)

monitor.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ use_geocode = True
88
use_geocode_email = True
99
language = en
1010
odometer_metric = km
11+
include_regenerate_in_consumption = False

0 commit comments

Comments
 (0)