Skip to content

Commit

Permalink
display seconds since last bms update
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalzauberzeug committed Sep 26, 2024
1 parent f71e8d6 commit dc4b263
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions field_friend/interface/components/battery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
from typing import TYPE_CHECKING

import rosys
from nicegui import ui

if TYPE_CHECKING:
Expand Down Expand Up @@ -33,8 +33,8 @@ def developer_ui(system: 'System') -> None:
system.field_friend.bms.state.is_charging))
with ui.row().classes('place-items-center'):
ui.label('Last Update:').classes('text-bold')
ui.label('No Data' if system.field_friend.bms.state.last_update is None else str(
datetime.datetime.fromtimestamp(system.field_friend.bms.state.last_update).strftime("%H:%M:%S.%f")[:-3]))
ui.label(
'No Data' if system.field_friend.bms.state.last_update is None else f'{(rosys.time() - system.field_friend.bms.state.last_update):.4f}s')
with ui.row().classes('place-items-center'):
ui.label('Battery Control:').classes('text-bold')
if hasattr(system.field_friend, 'battery_control') and system.field_friend.battery_control is not None:
Expand Down

0 comments on commit dc4b263

Please sign in to comment.