Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
Adăugat IDX în atributele plăților pentru a gestiona multiple plăți pe lună.
  • Loading branch information
cnecrea authored Feb 7, 2025
1 parent b8235c3 commit 680aa49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/eonromania/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def extra_state_attributes(self):
# Calculăm totalul plăților
total_value = sum(p.get("value", 0) for p in payments_list)

# Adăugăm informații despre fiecare plată
# Adăugăm informații despre fiecare plată, incluzând IDX
for idx, payment in enumerate(payments_list, start=1):
raw_date = payment.get("paymentDate", "N/A")
payment_value = payment.get("value", 0)
Expand All @@ -718,7 +718,7 @@ def extra_state_attributes(self):
else:
month_name = "necunoscut"

attributes[f"Plată factură luna {month_name}"] = f"{payment_value:.2f} lei"
attributes[f"Plată {idx} factură luna {month_name}"] = f"{payment_value:.2f} lei"

attributes["---------------"] = ""
attributes["Plăți efectuate"] = len(payments_list)
Expand Down

0 comments on commit 680aa49

Please sign in to comment.