Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change naming from incl_btw to incl_vat #219

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ from energyzero import EnergyZero

async def main() -> None:
"""Show example on fetching the energy prices from EnergyZero."""
async with EnergyZero(incl_btw="true") as client:
async with EnergyZero(incl_vat=True) as client:
start_date = date(2022, 12, 7)
end_date = date(2022, 12, 7)

Expand All @@ -92,7 +92,7 @@ if __name__ == "__main__":

| Parameter | value Type | Description |
| :-------- | :--------- | :---------- |
| `incl_btw` | str (default: **true**) | Include or exclude BTW |
| `incl_vat` | bool (default: **True**) | Include or exclude VAT |

### Function Parameters

Expand Down
6 changes: 3 additions & 3 deletions src/energyzero/energyzero.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class EnergyZero:
"""Main class for handling data fetching from EnergyZero."""

incl_btw: str = "true"
incl_vat: bool = True
request_timeout: float = 10.0
session: ClientSession | None = None

Expand Down Expand Up @@ -180,7 +180,7 @@ async def gas_prices(
"tillDate": utc_end_date.strftime("%Y-%m-%dT%H:%M:%S.999Z"),
"interval": interval,
"usageType": 3,
"inclBtw": self.incl_btw.lower(),
"inclBtw": "true" if self.incl_vat else "false",
},
)

Expand Down Expand Up @@ -238,7 +238,7 @@ async def energy_prices(
"tillDate": utc_end_date.strftime("%Y-%m-%dT%H:%M:%S.999Z"),
"interval": interval,
"usageType": 1,
"inclBtw": self.incl_btw.lower(),
"inclBtw": "true" if self.incl_vat else "false",
},
)

Expand Down