Skip to content

Commit

Permalink
nestup_evn: chỉ hỗ trợ lịch cắt điện cho EVNSPC
Browse files Browse the repository at this point in the history
  • Loading branch information
chautruongthinh committed Dec 22, 2024
1 parent caa440f commit de0670d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions custom_components/nestup_evn/nestup_evn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,15 @@ def formatted_result(raw_data: dict) -> dict:
),
}

original_content = raw_data.get(ID_LOADSHEDDING, "Không hỗ trợ")
formatted_content = (
format_loadshedding(original_content) if original_content != "Không hỗ trợ" else STATUS_LOADSHEDDING
)
if raw_data.get(ID_LOADSHEDDING) is not None:
original_content = raw_data.get(ID_LOADSHEDDING)
formatted_content = (
format_loadshedding(original_content)
if original_content
else STATUS_LOADSHEDDING
)
else:
formatted_content = "Không hỗ trợ"

res[ID_LOADSHEDDING] = {
"value": formatted_content,
Expand All @@ -1052,7 +1057,6 @@ def formatted_result(raw_data: dict) -> dict:

return res


def get_evn_info(evn_customer_id: str):
"""Get EVN infomations based on Customer ID -> EVN Company, location, branches,..."""

Expand Down

0 comments on commit de0670d

Please sign in to comment.