aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/elvia.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.py
parentsmall fixes (diff)
downloadenergyscripts-4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad.tar.gz
added new function to get env
which handles missing env better...
Diffstat (limited to 'scripts/elvia.py')
-rw-r--r--scripts/elvia.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/elvia.py b/scripts/elvia.py
index fea0f61..fffb6bf 100644
--- a/scripts/elvia.py
+++ b/scripts/elvia.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
""" Get energy consumption from Elvia """
-import os
import sys
from datetime import datetime, timedelta
@@ -9,7 +8,7 @@ import common
import requests
from tzlocal import get_localzone
-apiKey = os.environ["el_elvia_token"]
+apiKey = common.env("el_elvia_token")
apiUrl = "https://elvia.azure-api.net/customer/metervalues/api/v1/metervalues"
startTime = datetime.now(get_localzone()) - timedelta(days=2)