Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Oct 13, 2023
1 parent bcbeb36 commit 1a86e44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
24 changes: 15 additions & 9 deletions wideboy/scenes/default/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,25 @@ def setup(self):
dict(
entity_id="sensor.octopus_energy_electricity_current_demand",
icon=MaterialIcons.MDI_BOLT,
icon_color=Color(255, 64, 64, 255),
icon_color=Color(192, 192, 192, 255),
template="{{ states('sensor.octopus_energy_electricity_current_demand') | int }}w",
),
dict(
entity_id="sensor.octopus_energy_electricity_current_rate",
icon=MaterialIcons.MDI_CURRENCY_DOLLAR,
icon_color=Color(255, 128, 255, 255),
icon=MaterialIcons.MDI_SYMBOL_AT,
icon_color=Color(192, 192, 192, 255),
template="£{{ '{:.2f}'.format(states('sensor.octopus_energy_electricity_current_rate') | float) }}",
),
dict(
entity_id="sensor.octopus_energy_electricity_current_accumulative_cost",
entity_id="sensor.octopus_energy_electricity_current_demand",
icon=MaterialIcons.MDI_CURRENCY_DOLLAR,
icon_color=Color(255, 255, 255, 255),
icon_color=Color(255, 64, 64, 255),
template="£{{ '{:.2f}'.format(int(states('sensor.octopus_energy_electricity_current_demand')) / 1000 * float(states('sensor.octopus_energy_electricity_current_rate'))) }}",
),
dict(
entity_id="sensor.octopus_energy_electricity_current_accumulative_cost",
icon=MaterialIcons.MDI_SCHEDULE,
icon_color=Color(255, 64, 64, 255),
template="£{{ '{:.2f}'.format(states('sensor.octopus_energy_electricity_current_accumulative_cost') | float) }}",
)
]
Expand All @@ -242,21 +248,21 @@ def setup(self):
dict(
entity_id="sensor.delta_2_max_downstairs_battery_level",
icon=MaterialIcons.MDI_BATTERY,
icon_color=Color(255, 255, 128, 255),
icon_color=Color(192, 192, 192, 255),
template="{{ states('sensor.delta_2_max_downstairs_battery_level') | int }}%",
),
dict(
entity_id="sensor.delta_2_max_downstairs_discharge_remaining_time",
icon=MaterialIcons.MDI_HOURGLASS,
icon_color=Color(255, 64, 64, 255),
template="{{ states('sensor.delta_2_max_downstairs_discharge_remaining_time') | int }}m",
cb_active=lambda state: 0 > float(state.state) > 60,
template="{{ (states('sensor.delta_2_max_downstairs_discharge_remaining_time') | int) // 60 }}h{{ '{:2d}'.format((states('sensor.delta_2_max_downstairs_discharge_remaining_time') | int) % 60) }}m",
cb_active=lambda state: float(state.state) > 0,
),
dict(
entity_id="sensor.delta_2_max_downstairs_charge_remaining_time",
icon=MaterialIcons.MDI_HOURGLASS,
icon_color=Color(64, 255, 64, 255),
template="{{ states('sensor.delta_2_max_downstairs_charge_remaining_time') | int }}m",
template="{{ (states('sensor.delta_2_max_downstairs_charge_remaining_time') | int) // 60 }}h{{ '{:2d}'.format((states('sensor.delta_2_max_downstairs_charge_remaining_time') | int) % 60) }}m",
cb_active=lambda state: float(state.state) > 0,
),
dict(
Expand Down
4 changes: 4 additions & 0 deletions wideboy/sprites/image_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ class MaterialIcons:
MDI_SCHEDULE = 0xE8B5
MDI_HOURGLASS = 0xE88C
MDI_POWER = 0xE63C
MDI_SYMBOL_AT = 0xE0E6
MDI_CALENDAR_TODAY = 0xE935
MDI_LIGHT_MODE = 0xE518
MDI_SCHEDULE = 0xE8B5


def render_material_icon(
Expand Down

0 comments on commit 1a86e44

Please sign in to comment.