Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:02:19 +01:00
parent 6037e742cc
commit 324dd1414b
132 changed files with 1228 additions and 706 deletions
+8 -5
View File
@@ -1,4 +1,7 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
import pytz
import requests
@@ -17,11 +20,11 @@ class POTA(HTTPSpotProvider):
SPOTS_URL = "https://api.pota.app/spot/activator"
SUBMIT_URL = "https://api.pota.app/spot"
def __init__(self, provider_config):
def __init__(self, provider_config: dict[str, Any]) -> None:
super().__init__("POTA", provider_config, self.SPOTS_URL, self.POLL_INTERVAL_SEC)
def _http_response_to_spots(self, http_response):
new_spots = []
def _http_response_to_spots(self, http_response: requests.Response) -> list[Spot]:
new_spots: list[Spot] = []
# Iterate through source data
for source_spot in http_response.json():
# Convert to our spot format
@@ -57,10 +60,10 @@ class POTA(HTTPSpotProvider):
new_spots.append(spot)
return new_spots
def can_submit_spot(self, activity):
def can_submit_spot(self, activity: str) -> bool:
return activity == ActivityName.POTA
def submit_spot(self, spot, credentials):
def submit_spot(self, spot: Spot, credentials: dict[str, str]) -> None:
sig_ref = spot.sig_refs[0].id if spot.sig_refs else None
if sig_ref:
body = {