From 4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Thu, 9 Nov 2023 13:57:26 +0100 Subject: added new function to get env which handles missing env better... --- scripts/elvia_gridtariff.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts/elvia_gridtariff.py') diff --git a/scripts/elvia_gridtariff.py b/scripts/elvia_gridtariff.py index 98164bb..4475c48 100644 --- a/scripts/elvia_gridtariff.py +++ b/scripts/elvia_gridtariff.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 """ get grid tariffs""" -import os import sys from datetime import datetime, timedelta @@ -11,9 +10,9 @@ from tzlocal import get_localzone # API documentation: https://elvia.portal.azure-api.net/docs/services/gridtariffapi/operations/post-digin-api-v-tariffquery-meteringpointsgridtariffs? -apiKey = os.environ["el_elvia_grid_api_key"] +apiKey = common.env("el_elvia_grid_api_key") apiUrl = "https://elvia.azure-api.net/grid-tariff/digin/api/1/tariffquery/meteringpointsgridtariffs" -meteringPointId = os.environ["el_meteringPointId"] +meteringPointId = common.env("el_meteringPointId") startTime = datetime.now(get_localzone()) - timedelta(days=2) startTime = startTime.strftime("%Y-%m-%d") -- cgit v1.2.3