Skip to content

Commit

Permalink
#326 do it
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Feb 21, 2024
1 parent 5d5d09f commit 8f55066
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/peaqev/sensors/money_sensor_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from peaqevcore.common.currency_translation import currency_translation
from peaqevcore.services.hoursselection_service_new.models.hour_price import \
HourPrice
from peaqevcore.services.hoursselection_service_new.models.permittance_type import PermittanceType

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -71,11 +72,15 @@ def set_all_hours_display(future_hours: list[HourPrice], tomorrow_valid: bool) -

match h.permittance:
case 0:
ret[str(dt_string)] = "-"
ret[str(dt_string)] = ""
case 1:
ret[str(dt_string)] = "Charge"
case _:
ret[str(dt_string)] = f"Caution {str(int(h.permittance * 100))}%"

if h.permittance_type is PermittanceType.MaxMin:
ret[str(dt_string)] = f"{ret[str(dt_string)]} ★"

return ret


Expand Down

0 comments on commit 8f55066

Please sign in to comment.