Skip to content

Commit

Permalink
Update downloader.py
Browse files Browse the repository at this point in the history
change year for smart metters to 9999
  • Loading branch information
Antrac1t authored Aug 9, 2023
1 parent bb774a7 commit 567c549
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions custom_components/egddistribuce/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 567c549

Please sign in to comment.