From f6f799e85fc4157a8de309f67f01db89cbb2918a Mon Sep 17 00:00:00 2001 From: Adrian Rumpold Date: Thu, 11 Nov 2021 19:50:44 +0100 Subject: [PATCH] fix(crawler): Fix invalid calculation of number of first vaccinations Numbers for second shot are actually inclusive of booster shots, so booster shots do not have to be subtracted from the total number of vaccinations. Fixes #10. --- custom_components/home_assistant_covid19_augsburg/crawler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/home_assistant_covid19_augsburg/crawler.py b/custom_components/home_assistant_covid19_augsburg/crawler.py index c223a23..13cdc76 100644 --- a/custom_components/home_assistant_covid19_augsburg/crawler.py +++ b/custom_components/home_assistant_covid19_augsburg/crawler.py @@ -187,8 +187,8 @@ class CovidCrawler(CovidCrawlerBase): if not matches: raise ValueError(f"Could not extract date from scraped web page, {text=}") - values["num_vaccinated_once"] = values["total_vaccinations"] - ( - values["num_vaccinated_full"] + values["num_vaccinated_booster"] + values["num_vaccinated_once"] = ( + values["total_vaccinations"] - values["num_vaccinated_full"] ) values["date"] = parse_date(**matches.groupdict()).strftime("%Y-%m-%d")