aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/elvia_gridtariff.py
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-11-09 13:57:26 +0100
committerDennis Eriksen <d@ennis.no>2023-11-09 13:57:26 +0100
commit4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad (patch)
treed605620535229e741f7e2da473086fe185f78e5f /scripts/elvia_gridtariff.py
parentsmall fixes (diff)
downloadenergyscripts-4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad.tar.gz
added new function to get env
which handles missing env better...
Diffstat (limited to 'scripts/elvia_gridtariff.py')
-rw-r--r--scripts/elvia_gridtariff.py5
1 files changed, 2 insertions, 3 deletions
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")