Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Nov 5, 2023
1 parent 1f944b9 commit 3da7d74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wideboy/scenes/default/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def setup(self):
dict(
icon=MaterialIcons.MDI_HOURGLASS,
icon_color=Color(255, 64, 64, 255),
template="{state[sensor.delta_2_max_downstairs_discharge_remaining_time]:.0f}m",
template=lambda state: f"{int(state['sensor.delta_2_max_downstairs_discharge_remaining_time']//60)}h{int(state['sensor.delta_2_max_downstairs_discharge_remaining_time']%60)}m",
cb_active=lambda state: state[
"sensor.delta_2_max_downstairs_discharge_remaining_time"
]
Expand All @@ -283,7 +283,7 @@ def setup(self):
dict(
icon=MaterialIcons.MDI_HOURGLASS,
icon_color=Color(64, 255, 64, 255),
template="{state[sensor.delta_2_max_downstairs_charge_remaining_time]:.0f}m",
template=lambda state: f"{int(state['sensor.delta_2_max_downstairs_charge_remaining_time']//60)}h{int(state['sensor.delta_2_max_downstairs_charge_remaining_time']%60)}m",
cb_active=lambda state: state[
"sensor.delta_2_max_downstairs_charge_remaining_time"
]
Expand Down
2 changes: 1 addition & 1 deletion wideboy/sprites/homeassistant/entity_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def render(self) -> None:
logger.warn(f"hass:entity_row callback error={e}", exc_info=e)

try:
if isinstance(template, types.FunctionType):
if isinstance(template, types.LambdaType):
label = template(self.scene.hass.state)
else:
label = template.format(state=self.scene.hass.state)
Expand Down

0 comments on commit 3da7d74

Please sign in to comment.