From e0d6e1f756ff6dfb84b1204ba2f11bdb989c6c97 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Wed, 4 Oct 2023 00:36:06 +0200 Subject: [PATCH] Change naming for incl_btw to incl_vat --- README.md | 4 ++-- src/energyzero/energyzero.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8667b3a..584b820 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/src/energyzero/energyzero.py b/src/energyzero/energyzero.py index 6ae78bf..533f949 100644 --- a/src/energyzero/energyzero.py +++ b/src/energyzero/energyzero.py @@ -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 @@ -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", }, ) @@ -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", }, )