diff options
author | Dennis Eriksen <d@ennis.no> | 2023-11-09 13:57:26 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-11-09 13:57:26 +0100 |
commit | 4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad (patch) | |
tree | d605620535229e741f7e2da473086fe185f78e5f /scripts/elvia.py | |
parent | small fixes (diff) | |
download | energyscripts-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.py | 3 |
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) |