From 85e2c2eacaf28f4bc0ae6eea2c589dadca1a7813 Mon Sep 17 00:00:00 2001 From: fvaleye Date: Wed, 22 Mar 2023 18:05:40 +0100 Subject: [PATCH] Make country code in lowercase --- pyproject.toml | 2 +- tracarbon/locations/country.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 317b762..3a9c80f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "tracarbon" authors = ["Florian Valeye "] -version = "0.6.0" +version = "0.6.1" description = "Tracarbon is a Python library that tracks your device's energy consumption and calculates your carbon emissions." readme = "README.md" license = "Apache-2.0" diff --git a/tracarbon/locations/country.py b/tracarbon/locations/country.py index 92e1fa5..7e0f69f 100644 --- a/tracarbon/locations/country.py +++ b/tracarbon/locations/country.py @@ -56,7 +56,7 @@ def get_current_country( logger.debug(f"Send request to this url: {url}, timeout {timeout}s") text = requests.get(url, timeout=timeout).text content_json = ujson.loads(text) - return content_json["country"] + return content_json["country"].lower() except Exception as exception: logger.error(f"Failed to request this url: {url}") raise exception