Archived
1
1
Fork 0

tui: misc fixes - var/comments

tui: misc fixes - var/comments
This commit is contained in:
Josh Lay 2023-04-30 17:46:39 -05:00 committed by GitHub
commit 6a7964285e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,8 +155,8 @@ class MiscDisplay(Static):
fan_rpm = reactive(0)
fan_rpm_target = reactive(0)
# do some dancing to craft the UI; initialize the reactive obj with data
# to get proper labels
# dynamic object for temperature updates
# populated / looped in '__init__' to get proper labels
temp_stats = reactive({})
# default to 'not composed', once labels are made - become true
# avoids a race condition between discovering temperature nodes/stats
@ -167,13 +167,12 @@ class MiscDisplay(Static):
super().__init__(*args, **kwargs)
self.timer_misc = None
self.card = card
self.initial_stats = get_temp_stats(self.card)
self.temp_stats = get_temp_stats(self.card)
def compose(self) -> ComposeResult:
yield Horizontal(Label("[underline]Temperatures"),
Label("", classes="statvalue"))
for temp_node in self.initial_stats:
for temp_node in self.temp_stats:
# capitalize the first letter for display
caption = temp_node[0].upper() + temp_node[1:]
yield Horizontal(Label(f' {caption}:',),