Skip to content

Commit

Permalink
Change naming for incl_btw to incl_vat (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas authored Oct 10, 2023
1 parent 9168436 commit a86d4b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit a86d4b4

Please sign in to comment.