Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
Am adăugat suport pentru afișarea soldului negativ ca “Sold” în atributul principal.
  • Loading branch information
cnecrea authored Jan 14, 2025
1 parent 2b4d420 commit 7654a1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/hidroelectrica/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ def native_value(self):
logger.debug(f"Rembalance numeric value: {rembalance_value}")

# Returnăm 'Da' doar dacă rembalance este un număr pozitiv
if rembalance_value is not None and rembalance_value > 0:
if rembalance_value > 0:
return "Da"
elif rembalance_value < 0:
return "Sold"
else:
return "Nu"

Expand Down

0 comments on commit 7654a1e

Please sign in to comment.