diff --git a/custom_components/egddistribuce/downloader.py b/custom_components/egddistribuce/downloader.py index 734c12a..bd5a67c 100644 --- a/custom_components/egddistribuce/downloader.py +++ b/custom_components/egddistribuce/downloader.py @@ -29,15 +29,18 @@ def parseHDO(jsonHDO,HDORegion,HDO_A,HDO_B,HDO_DP): HDO_Date_Do=[] HDO_Cas_Od = [] HDO_Cas_Do = [] + dateNow = datetime.datetime.now().date() + dateNowTime = datetime.datetime.now() + #roll back + rounded_now = dateNowTime.replace(second=0, microsecond=0) + if len(HDORegion) == 2: + dateNow = dateNow.replace(year=9999) output_hdo_dict = [x for x in jsonHDO if x['skupinaPovelu'] == HDO_A and x['region'] == HDORegion] else: output_hdo_dict = [x for x in jsonHDO if x['A'] == HDO_A and x['B'] == HDO_B and (x['DP'] == HDO_DP or x['DP'] == '0' + HDO_DP) and x['region'] == HDORegion] - dateNow = datetime.datetime.now().date() - dateNowTime = datetime.datetime.now() - #roll back - rounded_now = dateNowTime.replace(second=0, microsecond=0) + HDOStatus=False