From 431664d8b96149beef01015f424051496e9c91d0 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 2 Sep 2024 16:47:46 +0200 Subject: [PATCH] IdentifyJsonMember(): Add "Monday" - "Sunday" as level-1 sections in a tariff-file. --- library/src/configuration.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/src/configuration.cpp b/library/src/configuration.cpp index ad51d7c..bf09b62 100644 --- a/library/src/configuration.cpp +++ b/library/src/configuration.cpp @@ -8,6 +8,8 @@ #include "tariff_global_defines.h" #include "tariff_carryover.h" #include "tariff_global_defines.h" +#include "tariff_settings.h" +#include "tariff_carryover_settings.h" #include #include @@ -21,7 +23,13 @@ MemberType Configuration::IdentifyJsonMember(const char* member_name) if (strcmp(member_name, "PaymentRate") == 0) return MemberType::PaymentRateType; if (strcmp(member_name, "PaymentOption") == 0) return MemberType::PaymentOptionType; if (strcmp(member_name, "Duration") == 0) return MemberType::DurationType; - //if (strcmp(member_name, "WeekDays") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Monday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Tuesday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Wednesday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Thursday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Friday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Saturday") == 0) return MemberType::WeekDaysType; + if (strcmp(member_name, "Sunday") == 0) return MemberType::WeekDaysType; if (strcmp(member_name, "WeekDaysWorktime") == 0) return MemberType::WeekDaysWorkTimeType; if (strcmp(member_name, "SpecialDaysWorktime") == 0) return MemberType::SpecialDaysWorktimeType; if (strcmp(member_name, "SpecialDays") == 0) return MemberType::SpecialDaysType;