Skip to content

Commit

Permalink
Fix bug incorrect transposing inc and exc vat rates
Browse files Browse the repository at this point in the history
  • Loading branch information
markallanson committed Feb 7, 2021
1 parent d31b5f5 commit 38ee674
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion octopus_energy/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def tariff_rates_from_response(response: dict) -> List[TariffRate]:
return []
return [
TariffRate(
Decimal(result["value_exc_vat"]).quantize(_QUANT_3DP, rounding=ROUND_DOWN),
Decimal(result["value_inc_vat"]).quantize(_QUANT_3DP, rounding=ROUND_DOWN),
Decimal(result["value_exc_vat"]).quantize(_QUANT_3DP, rounding=ROUND_DOWN),
from_timestamp_str(result["valid_from"]),
from_timestamp_str(result.get("valid_to", None)),
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "octopus-energy"
version = "0.1.12"
version = "0.1.13"
description = "Python client for the Octopus Energy RESTful API"
authors = ["Mark Allanson <[email protected]>"]
license = "MIT"
Expand Down
20 changes: 10 additions & 10 deletions tests/mapping_results/tariff_rate_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
{
"py/tuple": [
"20.640"
"21.672"
]
}
]
Expand All @@ -20,7 +20,7 @@
},
{
"py/tuple": [
"21.672"
"20.640"
]
}
]
Expand Down Expand Up @@ -74,7 +74,7 @@
},
{
"py/tuple": [
"18.460"
"19.382"
]
}
]
Expand All @@ -86,7 +86,7 @@
},
{
"py/tuple": [
"19.382"
"18.460"
]
}
]
Expand Down Expand Up @@ -129,7 +129,7 @@
},
{
"py/tuple": [
"18.460"
"19.382"
]
}
]
Expand All @@ -141,7 +141,7 @@
},
{
"py/tuple": [
"19.382"
"18.460"
]
}
]
Expand Down Expand Up @@ -184,7 +184,7 @@
},
{
"py/tuple": [
"18.460"
"19.382"
]
}
]
Expand All @@ -196,7 +196,7 @@
},
{
"py/tuple": [
"19.382"
"18.460"
]
}
]
Expand Down Expand Up @@ -239,7 +239,7 @@
},
{
"py/tuple": [
"18.000"
"18.899"
]
}
]
Expand All @@ -251,7 +251,7 @@
},
{
"py/tuple": [
"18.899"
"18.000"
]
}
]
Expand Down

0 comments on commit 38ee674

Please sign in to comment.