Skip to content

Commit

Permalink
Fix import error (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrencefoley authored Oct 27, 2021
1 parent 94ffd9e commit 80b7eab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
18 changes: 18 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import json

from evergy.evergy import Evergy


def get_creds():
with open("credentials.json", "r") as f:
return json.loads(f.read())


creds = get_creds()
username = creds["username"]
password = creds["password"]

evergy = Evergy(username, password)

data = evergy.get_usage()
print("Today's kWh: " + str(data[-1]["usage"]))
3 changes: 1 addition & 2 deletions evergy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__version__ = "2.0.2"

__version__ = "2.0.3"
17 changes: 1 addition & 16 deletions evergy/evergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import requests
from bs4 import BeautifulSoup
import utils
from . import utils

logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", level=logging.INFO
Expand Down Expand Up @@ -115,18 +115,3 @@ def get_usage_range(self, start: date = utils.get_past_date(0), end: date = util
raise Exception("Invalid login credentials")
return usage_response.json()["data"]


def get_creds():
with open("../credentials.json", "r") as f:
return json.loads(f.read())


if __name__ == "__main__":
creds = get_creds()
username = creds["username"]
password = creds["password"]

evergy = Evergy(username, password)

data = evergy.get_usage()
logging.info("Today's kWh: " + str(data[-1]["usage"]))

0 comments on commit 80b7eab

Please sign in to comment.