diff --git a/simple_dwd_weatherforecast/dwdforecast.py b/simple_dwd_weatherforecast/dwdforecast.py index 4995da4..be3edd8 100644 --- a/simple_dwd_weatherforecast/dwdforecast.py +++ b/simple_dwd_weatherforecast/dwdforecast.py @@ -998,9 +998,12 @@ def download_large_kml(self, stationid): save_next_next = True save_next = False - if stationid.encode() in chunk: + if f"{stationid}".encode() in chunk: chunk1 = chunk save_next = True + + if not chunk1: + raise BufferError("Station not found") if first_chunk: start = placemark.find(b"\n")