Skip to content

Commit

Permalink
EVNHCMC: Fix sản lượng hôm qua & hôm kia
Browse files Browse the repository at this point in the history
  • Loading branch information
chautruongthinh committed Dec 22, 2024
1 parent 9cea769 commit caa440f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/nestup_evn/nestup_evn.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,10 @@ async def request_update_evnhcmc(self, username, password, customer_id, from_dat

from_date = parser.parse(resp_json[0]["ngayFull"], dayfirst=True)
to_date = parser.parse(
resp_json[(-1 if len(resp_json) > 1 else 0)]["ngayFull"], dayfirst=True
resp_json[(-2 if len(resp_json) > 2 else 0)]["ngayFull"], dayfirst=True
)
previous_date = parser.parse(
resp_json[(-2 if len(resp_json) > 2 else 0)]["ngayFull"], dayfirst=True
resp_json[(-3 if len(resp_json) > 3 else 0)]["ngayFull"], dayfirst=True
)

econ_total_new = round(
Expand All @@ -548,15 +548,15 @@ async def request_update_evnhcmc(self, username, password, customer_id, from_dat
ID_ECON_TOTAL_NEW: econ_total_new,
ID_ECON_DAILY_NEW: round(
float(
str(resp_json[(-1 if len(resp_json) > 1 else 0)]["Tong"]).replace(
str(resp_json[(-2 if len(resp_json) > 2 else 0)]["Tong"]).replace(
",", ""
)
),
2,
),
ID_ECON_DAILY_OLD: round(
float(
str(resp_json[(-2 if len(resp_json) > 2 else 0)]["Tong"]).replace(
str(resp_json[(-3 if len(resp_json) > 3 else 0)]["Tong"]).replace(
",", ""
)
),
Expand Down

0 comments on commit caa440f

Please sign in to comment.