Skip to content

Commit 6f5ffcb

Browse files
committed
Add credit calculations
1 parent 9ac9199 commit 6f5ffcb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_opensky/opensky.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def _request(
107107

108108
async def states(self, bounding_box: BoundingBox | None = None) -> StatesResponse:
109109
"""Retrieve state vectors for a given time."""
110-
credit_costs = 4
110+
credit_cost = 4
111111
params = {
112112
"time": 0,
113113
"extended": "true",
@@ -119,7 +119,7 @@ async def states(self, bounding_box: BoundingBox | None = None) -> StatesRespons
119119
params[MAX_LATITUDE] = bounding_box.max_latitude
120120
params[MIN_LONGITUDE] = bounding_box.min_longitude
121121
params[MAX_LONGITUDE] = bounding_box.max_longitude
122-
credit_costs = self.calculate_credit_costs(bounding_box)
122+
credit_cost = self.calculate_credit_costs(bounding_box)
123123

124124
data = await self._request("states/all", data=params)
125125

@@ -149,7 +149,7 @@ async def states(self, bounding_box: BoundingBox | None = None) -> StatesRespons
149149
"states": [dict(zip(keys, state, strict=True)) for state in data["states"]],
150150
}
151151

152-
self._register_credit_usage(credit_costs)
152+
self._register_credit_usage(credit_cost)
153153

154154
return StatesResponse.parse_obj(data)
155155

0 commit comments

Comments
 (0)