Skip to content

Commit

Permalink
add effective_on_date to plan look up query (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Sep 23, 2021
1 parent b255be5 commit e5feb37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions openeihttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import datetime
import logging
import time
from typing import Any, Dict
import requests # type: ignore
from .const import BASE_URL
Expand Down Expand Up @@ -55,9 +56,11 @@ def lookup_plans(self) -> Dict[str, Any]:
_LOGGER.error("Missing location data for a plan lookup.")
raise InvalidCall

thetime = time.time()

url = f"{BASE_URL}version=latest&format=json"
url = f"{url}&api_key={self._api}"
url = f"{url}&sector=Residential"
url = f"{url}&api_key={self._api}&orderby=startdate"
url = f"{url}&sector=Residential&effective_on_date={thetime}"
if self._radius is not None:
url = f"{url}&radius={self._radius}"

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
VERSION = "0.1.16"
VERSION = "0.1.17"


setup(
Expand Down

0 comments on commit e5feb37

Please sign in to comment.