diff --git a/wideboy/scenes/default/__init__.py b/wideboy/scenes/default/__init__.py index 8cd87f6..45bd011 100644 --- a/wideboy/scenes/default/__init__.py +++ b/wideboy/scenes/default/__init__.py @@ -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) }}", ) ] @@ -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( diff --git a/wideboy/sprites/image_helpers.py b/wideboy/sprites/image_helpers.py index 32e05a1..094f2bc 100644 --- a/wideboy/sprites/image_helpers.py +++ b/wideboy/sprites/image_helpers.py @@ -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(