Skip to content

Commit

Permalink
solved interpolate error when config contains special characters in p…
Browse files Browse the repository at this point in the history
…assword, e.g. %
  • Loading branch information
ZuinigeRijder committed Dec 9, 2024
1 parent ddf3c20 commit b0af0a3
Show file tree
Hide file tree
Showing 40 changed files with 3,511 additions and 3,504 deletions.
4 changes: 2 additions & 2 deletions dailystats.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@

parser = configparser.ConfigParser()
parser.read(get_filepath("monitor.cfg"))
monitor_settings = dict(parser.items("monitor"))
monitor_settings = dict(parser.items("monitor", raw=True))
ODO_METRIC = get(monitor_settings, "odometer_metric", "km").lower()
REGION = monitor_settings["region"]
REGION = get(monitor_settings, "region", "1")
INCLUDE_REGENERATE_IN_CONSUMPTION = (
get(monitor_settings, "include_regenerate_in_consumption", "False").lower()
== "true"
Expand Down
4 changes: 2 additions & 2 deletions monitor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def read_translations() -> dict:
if len(TR_HELPER) == 0:
parser = configparser.ConfigParser()
parser.read(get_filepath("monitor.cfg"))
monitor_settings = dict(parser.items("monitor"))
language = monitor_settings["language"].lower().strip()
monitor_settings = dict(parser.items("monitor", raw=True))
language = get(monitor_settings, "language", "en").lower().strip()
translations_csv_file = Path(get_filepath("monitor.translations.csv"))
with translations_csv_file.open("r", encoding="utf-8") as inputfile:
linecount = 0
Expand Down
2 changes: 1 addition & 1 deletion summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
# == read monitor in monitor.cfg ===========================
config_parser = configparser.ConfigParser()
config_parser.read(get_filepath("monitor.cfg"))
monitor_settings = dict(config_parser.items("monitor"))
monitor_settings = dict(config_parser.items("monitor", raw=True))
ODO_METRIC = get(monitor_settings, "odometer_metric", "km").lower()
CONSUMPTION_EFFICIENCY_FACTOR_SUMMARY = to_float(
get(monitor_settings, "consumption_efficiency_factor_summary", "1.0")
Expand Down
26 changes: 13 additions & 13 deletions tests/OUTPUT/hyundai-kia-connect-monitor.dump

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions tests/OUTPUT/monitor.dailystats.dump

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/OUTPUT/summary.charge.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ date, odometer, +kWh, end charged SOC%
2023-01-22, 22780.8, 71.1, 98
2023-01-29, 22987.5, 4.4, 30
2023-01-30, 22987.5, 21.8, 60
2023-02-07, 23063.2, 8.0, 49
2023-02-08, 23068.4, 8.0, 60
2023-02-07, 23063.2, 8, 49
2023-02-08, 23068.4, 8, 60
2023-02-14, 23157.4, 7.3, 51
2023-02-15, 23167.5, 3.6, 50
2023-02-16, 23167.5, 21.8, 80
Expand Down
64 changes: 32 additions & 32 deletions tests/OUTPUT/summary.day.csv
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
date, odometer, distance, -kWh, +kWh
2023-01-02, 21850.6, 3.5, 0.0, 0.0
2023-01-03, 21919.9, 69.3, -12.3, 0.0
2023-01-04, 21919.9, 0.0, -7.3, 0.0
2023-01-06, 21973.1, 53.2, -5.1, 0.0
2023-01-07, 21977.2, 4.1, -1.5, 0.0
2023-01-08, 22132.2, 155.0, -22.5, 44.3
2023-01-10, 22148.9, 16.7, -5.1, 0.0
2023-01-11, 22157.3, 8.4, -0.7, 0.0
2023-01-12, 22162.2, 4.9, 0.0, 0.0
2023-01-13, 22163.4, 1.2, -1.5, 0.0
2023-01-14, 22167.5, 4.1, -0.7, 0.0
2023-01-02, 21850.6, 3.5, 0, 0
2023-01-03, 21919.9, 69.3, -12.3, 0
2023-01-04, 21919.9, 0, -7.3, 0
2023-01-06, 21973.1, 53.2, -5.1, 0
2023-01-07, 21977.2, 4.1, -1.5, 0
2023-01-08, 22132.2, 155, -22.5, 44.3
2023-01-10, 22148.9, 16.7, -5.1, 0
2023-01-11, 22157.3, 8.4, -0.7, 0
2023-01-12, 22162.2, 4.9, 0, 0
2023-01-13, 22163.4, 1.2, -1.5, 0
2023-01-14, 22167.5, 4.1, -0.7, 0
2023-01-15, 22323.0, 155.5, -27.6, 34.8
2023-01-16, 22328.6, 5.6, -1.5, 0.0
2023-01-17, 22334.4, 5.8, -1.5, 0.0
2023-01-18, 22344.6, 10.2, -2.2, 0.0
2023-01-20, 22348.1, 3.5, -2.2, 0.0
2023-01-16, 22328.6, 5.6, -1.5, 0
2023-01-17, 22334.4, 5.8, -1.5, 0
2023-01-18, 22344.6, 10.2, -2.2, 0
2023-01-20, 22348.1, 3.5, -2.2, 0
2023-01-21, 22361.9, 13.8, -3.6, 18.1
2023-01-22, 22780.8, 418.9, -63.2, 71.1
2023-01-23, 22794.2, 13.4, -2.9, 0.0
2023-01-24, 22813.9, 19.7, -5.8, 0.0
2023-01-25, 22826.4, 12.5, -2.2, 0.0
2023-01-27, 22832.4, 6.0, -2.2, 0.0
2023-01-23, 22794.2, 13.4, -2.9, 0
2023-01-24, 22813.9, 19.7, -5.8, 0
2023-01-25, 22826.4, 12.5, -2.2, 0
2023-01-27, 22832.4, 6, -2.2, 0
2023-01-29, 22987.5, 155.1, -31.9, 4.4
2023-01-30, 22987.5, 0.0, 0.0, 21.8
2023-01-31, 22999.2, 11.7, -0.7, 0.0
2023-02-01, 23040.1, 40.9, -8.7, 0.0
2023-02-04, 23047.1, 7.0, -3.6, 0.0
2023-02-05, 23054.4, 7.3, -1.5, 0.0
2023-02-06, 23056.7, 2.3, 0.0, 0.0
2023-02-07, 23063.2, 6.5, 0.0, 8.0
2023-02-08, 23068.4, 5.2, 0.0, 8.0
2023-02-09, 23082.7, 14.3, -1.5, 0.0
2023-02-10, 23111.7, 29.0, -5.8, 0.0
2023-02-11, 23137.2, 25.5, -6.5, 0.0
2023-01-30, 22987.5, 0, 0, 21.8
2023-01-31, 22999.2, 11.7, -0.7, 0
2023-02-01, 23040.1, 40.9, -8.7, 0
2023-02-04, 23047.1, 7, -3.6, 0
2023-02-05, 23054.4, 7.3, -1.5, 0
2023-02-06, 23056.7, 2.3, 0, 0
2023-02-07, 23063.2, 6.5, 0, 8
2023-02-08, 23068.4, 5.2, 0, 8
2023-02-09, 23082.7, 14.3, -1.5, 0
2023-02-10, 23111.7, 29, -5.8, 0
2023-02-11, 23137.2, 25.5, -6.5, 0
2023-02-14, 23157.4, 20.2, -2.2, 7.3
2023-02-15, 23167.5, 10.1, -2.2, 3.6
2023-02-16, 23167.5, 0.0, 0.0, 21.8
2023-02-17, 23167.5, 0.0, 0.0, 0.0
2023-02-16, 23167.5, 0, 0, 21.8
2023-02-17, 23167.5, 0, 0, 0
2023-02-18, 23575.6, 408.1, -75.5, 31.9
2023-02-19, 23589.5, 13.9, -2.2, 27.6
162 changes: 81 additions & 81 deletions tests/OUTPUT/summary.trip.csv
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
date, odometer, distance, -kWh, +kWh
2023-01-02 16:38, 21848.4, 1.3, 0.0, 0.0
2023-01-02 16:38, 21850.6, 2.2, 0.0, 0.0
2023-01-03 12:22, 21857.5, 6.9, -1.5, 0.0
2023-01-03 19:32, 21919.9, 62.4, -10.9, 0.0
2023-01-06 16:08, 21973.1, 53.2, -5.1, 0.0
2023-01-07 13:34, 21977.2, 4.1, -1.5, 0.0
2023-01-02 16:38, 21848.4, 1.3, 0, 0
2023-01-02 16:38, 21850.6, 2.2, 0, 0
2023-01-03 12:22, 21857.5, 6.9, -1.5, 0
2023-01-03 19:32, 21919.9, 62.4, -10.9, 0
2023-01-06 16:08, 21973.1, 53.2, -5.1, 0
2023-01-07 13:34, 21977.2, 4.1, -1.5, 0
2023-01-08 15:48, 22055.4, 78.2, -15.2, 44.3
2023-01-08 17:13, 22132.2, 76.8, -7.3, 0.0
2023-01-10 13:24, 22140.6, 8.4, -2.2, 0.0
2023-01-10 13:41, 22148.9, 8.3, -1.5, 0.0
2023-01-11 12:27, 22157.3, 8.4, -0.7, 0.0
2023-01-12 14:02, 22161.0, 3.7, 0.0, 0.0
2023-01-12 15:35, 22162.2, 1.2, 0.0, 0.0
2023-01-13 09:04, 22162.2, 0.0, 0.0, 0.0
2023-01-13 10:15, 22163.4, 1.2, -1.5, 0.0
2023-01-14 13:58, 22165.5, 2.1, -0.7, 0.0
2023-01-14 14:27, 22167.5, 2.0, 0.0, 0.0
2023-01-15 13:41, 22244.9, 77.4, -16.0, 0.0
2023-01-15 17:30, 22245.5, 0.6, 0.0, 3.6
2023-01-08 17:13, 22132.2, 76.8, -7.3, 0
2023-01-10 13:24, 22140.6, 8.4, -2.2, 0
2023-01-10 13:41, 22148.9, 8.3, -1.5, 0
2023-01-11 12:27, 22157.3, 8.4, -0.7, 0
2023-01-12 14:02, 22161.0, 3.7, 0, 0
2023-01-12 15:35, 22162.2, 1.2, 0, 0
2023-01-13 09:04, 22162.2, 0, 0, 0
2023-01-13 10:15, 22163.4, 1.2, -1.5, 0
2023-01-14 13:34, 22165.5, 2.1, -0.7, 0
2023-01-14 14:27, 22167.5, 2, 0, 0
2023-01-15 13:41, 22244.9, 77.4, -16, 0
2023-01-15 17:30, 22245.5, 0.6, 0, 3.6
2023-01-15 19:17, 22323.0, 77.5, -11.6, 31.2
2023-01-16 10:49, 22327.1, 4.1, -1.5, 0.0
2023-01-16 17:50, 22328.6, 1.5, 0.0, 0.0
2023-01-17 14:54, 22334.4, 5.8, -1.5, 0.0
2023-01-18 09:50, 22339.5, 5.1, -1.5, 0.0
2023-01-18 12:19, 22344.6, 5.1, -0.7, 0.0
2023-01-20 13:47, 22346.4, 1.8, -0.7, 0.0
2023-01-20 16:57, 22348.1, 1.7, -1.5, 0.0
2023-01-16 10:49, 22327.1, 4.1, -1.5, 0
2023-01-16 17:50, 22328.6, 1.5, 0, 0
2023-01-17 14:54, 22334.4, 5.8, -1.5, 0
2023-01-18 09:50, 22339.5, 5.1, -1.5, 0
2023-01-18 12:19, 22344.6, 5.1, -0.7, 0
2023-01-20 13:47, 22346.4, 1.8, -0.7, 0
2023-01-20 14:12, 22348.1, 1.7, -1.5, 0
2023-01-21 10:46, 22351.7, 3.6, -1.5, 18.1
2023-01-21 13:25, 22355.2, 3.5, 0.0, 0.0
2023-01-21 19:07, 22361.9, 6.7, -2.2, 0.0
2023-01-22 03:15, 22369.4, 7.5, 0.0, 3.6
2023-01-21 13:25, 22355.2, 3.5, 0, 0
2023-01-21 19:07, 22361.9, 6.7, -2.2, 0
2023-01-22 03:15, 22369.4, 7.5, 0, 3.6
2023-01-22 11:06, 22567.8, 198.4, -44.3, 10.9
2023-01-22 12:13, 22571.2, 3.4, -0.7, 0.0
2023-01-22 12:50, 22574.6, 3.4, -0.7, 0.0
2023-01-22 13:46, 22578.0, 3.4, -0.7, 0.0
2023-01-22 14:34, 22581.4, 3.4, -0.7, 0.0
2023-01-22 15:58, 22634.2, 52.8, -7.3, 0.0
2023-01-22 17:14, 22726.0, 91.8, 0.0, 23.2
2023-01-22 12:13, 22571.2, 3.4, -0.7, 0
2023-01-22 12:50, 22574.6, 3.4, -0.7, 0
2023-01-22 13:46, 22578.0, 3.4, -0.7, 0
2023-01-22 14:34, 22581.4, 3.4, -0.7, 0
2023-01-22 15:58, 22634.2, 52.8, -7.3, 0
2023-01-22 17:14, 22726.0, 91.8, 0, 23.2
2023-01-22 18:42, 22780.8, 54.8, -8.7, 33.4
2023-01-23 10:58, 22784.6, 3.8, -1.5, 0.0
2023-01-23 11:16, 22788.0, 3.4, -0.7, 0.0
2023-01-23 11:44, 22792.2, 4.2, -0.7, 0.0
2023-01-23 11:56, 22794.2, 2.0, 0.0, 0.0
2023-01-24 16:29, 22813.9, 19.7, -5.8, 0.0
2023-01-25 10:32, 22817.5, 3.6, -0.7, 0.0
2023-01-25 11:02, 22821.1, 3.6, -0.7, 0.0
2023-01-25 12:45, 22826.4, 5.3, -0.7, 0.0
2023-01-27 17:16, 22832.4, 6.0, -2.2, 0.0
2023-01-29 11:12, 22909.8, 77.4, -16.0, 0.0
2023-01-29 17:17, 22987.5, 77.7, -16.0, 0.0
2023-01-31 14:44, 22992.7, 5.2, 0.0, 0.0
2023-01-31 15:13, 22996.1, 3.4, 0.0, 0.0
2023-01-31 15:26, 22997.6, 1.5, -0.7, 0.0
2023-01-31 15:38, 22999.2, 1.6, 0.0, 0.0
2023-02-01 10:38, 23018.8, 19.6, -4.4, 0.0
2023-02-01 12:28, 23023.8, 5.0, -0.7, 0.0
2023-02-01 14:14, 23040.1, 16.3, -3.6, 0.0
2023-02-04 18:56, 23047.1, 7.0, 0.0, 0.0
2023-02-05 00:23, 23054.4, 7.3, -1.5, 0.0
2023-02-06 12:59, 23055.9, 1.5, 0.0, 0.0
2023-02-06 16:09, 23056.7, 0.8, 0.0, 0.0
2023-02-07 12:29, 23057.9, 1.2, 0.0, 0.0
2023-02-07 14:28, 23060.5, 2.6, 0.0, 2.9
2023-02-07 14:44, 23063.2, 2.7, 0.0, 0.0
2023-02-08 12:29, 23065.7, 2.5, 0.0, 0.0
2023-02-08 12:39, 23068.4, 2.7, 0.0, 0.0
2023-02-09 13:13, 23076.2, 7.8, 0.0, 0.0
2023-02-09 19:07, 23082.7, 6.5, -1.5, 0.0
2023-02-10 13:41, 23084.1, 1.4, -0.7, 0.0
2023-02-10 14:16, 23097.1, 13.0, -2.2, 0.0
2023-02-10 15:37, 23110.3, 13.2, -2.2, 0.0
2023-02-10 16:49, 23111.7, 1.4, -0.7, 0.0
2023-02-11 13:23, 23123.8, 12.1, -4.4, 0.0
2023-02-11 14:23, 23129.2, 5.4, -0.7, 0.0
2023-02-11 14:40, 23137.2, 8.0, -1.5, 0.0
2023-02-14 14:29, 23139.8, 2.6, 0.0, 7.3
2023-02-14 14:53, 23148.1, 8.3, -0.7, 0.0
2023-02-14 15:35, 23153.6, 5.5, -0.7, 0.0
2023-02-14 15:54, 23157.4, 3.8, -0.7, 0.0
2023-02-15 09:38, 23162.4, 5.0, -0.7, 0.0
2023-02-15 12:13, 23167.5, 5.1, -1.5, 0.0
2023-01-23 10:58, 22784.6, 3.8, -1.5, 0
2023-01-23 11:16, 22788.0, 3.4, -0.7, 0
2023-01-23 11:44, 22792.2, 4.2, -0.7, 0
2023-01-23 11:56, 22794.2, 2, 0, 0
2023-01-24 16:29, 22813.9, 19.7, -5.8, 0
2023-01-25 10:32, 22817.5, 3.6, -0.7, 0
2023-01-25 11:02, 22821.1, 3.6, -0.7, 0
2023-01-25 12:45, 22826.4, 5.3, -0.7, 0
2023-01-27 17:16, 22832.4, 6, -2.2, 0
2023-01-29 11:12, 22909.8, 77.4, -16, 0
2023-01-29 17:07, 22987.5, 77.7, -16, 0
2023-01-31 14:44, 22992.7, 5.2, 0, 0
2023-01-31 15:13, 22996.1, 3.4, 0, 0
2023-01-31 15:26, 22997.6, 1.5, -0.7, 0
2023-01-31 15:38, 22999.2, 1.6, 0, 0
2023-02-01 10:38, 23018.8, 19.6, -4.4, 0
2023-02-01 12:28, 23023.8, 5, -0.7, 0
2023-02-01 14:14, 23040.1, 16.3, -3.6, 0
2023-02-04 18:56, 23047.1, 7, 0, 0
2023-02-05 00:23, 23054.4, 7.3, -1.5, 0
2023-02-06 12:59, 23055.9, 1.5, 0, 0
2023-02-06 16:09, 23056.7, 0.8, 0, 0
2023-02-07 12:29, 23057.9, 1.2, 0, 0
2023-02-07 14:28, 23060.5, 2.6, 0, 2.9
2023-02-07 14:44, 23063.2, 2.7, 0, 0
2023-02-08 12:29, 23065.7, 2.5, 0, 0
2023-02-08 12:39, 23068.4, 2.7, 0, 0
2023-02-09 13:13, 23076.2, 7.8, 0, 0
2023-02-09 15:41, 23082.7, 6.5, -1.5, 0
2023-02-10 13:41, 23084.1, 1.4, -0.7, 0
2023-02-10 14:16, 23097.1, 13, -2.2, 0
2023-02-10 15:37, 23110.3, 13.2, -2.2, 0
2023-02-10 16:49, 23111.7, 1.4, -0.7, 0
2023-02-11 13:23, 23123.8, 12.1, -4.4, 0
2023-02-11 14:23, 23129.2, 5.4, -0.7, 0
2023-02-11 14:40, 23137.2, 8, -1.5, 0
2023-02-14 14:29, 23139.8, 2.6, 0, 7.3
2023-02-14 14:53, 23148.1, 8.3, -0.7, 0
2023-02-14 15:35, 23153.6, 5.5, -0.7, 0
2023-02-14 15:54, 23157.4, 3.8, -0.7, 0
2023-02-15 09:38, 23162.4, 5, -0.7, 0
2023-02-15 12:13, 23167.5, 5.1, -1.5, 0
2023-02-18 11:05, 23365.0, 197.5, -36.3, 13.1
2023-02-18 12:13, 23368.4, 3.4, -0.7, 0.0
2023-02-18 12:13, 23368.4, 3.4, -0.7, 0
2023-02-18 13:34, 23371.2, 2.8, -0.7, 18.9
2023-02-18 13:56, 23374.5, 3.3, 0.0, 0.0
2023-02-18 14:47, 23377.8, 3.3, -0.7, 0.0
2023-02-18 17:29, 23575.6, 197.8, -37.0, 0.0
2023-02-18 13:56, 23374.5, 3.3, 0, 0
2023-02-18 14:47, 23377.8, 3.3, -0.7, 0
2023-02-18 17:29, 23575.6, 197.8, -37, 0
2023-02-19 13:58, 23582.8, 7.2, -1.5, 27.6
2023-02-19 17:48, 23589.5, 6.7, -0.7, 0.0
2023-02-19 17:48, 23589.5, 6.7, -0.7, 0
Loading

0 comments on commit b0af0a3

Please sign in to comment.