22 lines
601 B
Python
22 lines
601 B
Python
from urllib.parse import quote
|
|
|
|
from . import poBaseURL
|
|
from .urlreader import UrlReader
|
|
|
|
|
|
class PoHistory(UrlReader):
|
|
|
|
def __init__(self, station: str, days: int):
|
|
super().__init__(poBaseURL + 'stations/%s/W/measurements.png?start=P%dD' % (quote(station), days))
|
|
|
|
def download(self):
|
|
print("download: Lade Bild herunter...")
|
|
|
|
image_data = self.getDataResponse()
|
|
if image_data is None or len(image_data) == 0:
|
|
print("download: Fehler: Keine Daten erhalten")
|
|
return None
|
|
|
|
print("download: Vollständig")
|
|
return image_data
|