Skip to content

Commit

Permalink
Stash
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Nov 3, 2023
1 parent e36137c commit f21702e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wideboy/scenes/default/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def setup(self):
dict(
icon=MaterialIcons.MDI_CURRENCY_DOLLAR,
icon_color=Color(255, 64, 64, 255),
template="£{{ ( (states['sensor.octopus_energy_electricity_current_demand'] | float / 1000) * (states['sensor.octopus_energy_electricity_current_rate'] | float) ) | currency_gbp }}",
template="£{{ ( (states['sensor.octopus_energy_electricity_current_demand'] | float / 1000) * (states['sensor.octopus_energy_electricity_current_rate'] | float) ) | currency }}",
watch_entities=[
"sensor.octopus_energy_electricity_current_demand",
"sensor.octopus_energy_electricity_current_rate",
Expand Down
6 changes: 3 additions & 3 deletions wideboy/sprites/homeassistant/entity_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
j2env = Environment()


def numberFormat(value):
return value
def format_currency(amount):
return "{:,.2f}".format(amount)


j2env.filters["numberFormat"] = numberFormat
j2env.filters["currency"] = format_currency


class HomeAssistantEntityRowSprite(BaseSprite):
Expand Down

0 comments on commit f21702e

Please sign in to comment.