Skip to content

Commit

Permalink
add component to table format
Browse files Browse the repository at this point in the history
  • Loading branch information
jblance authored Jan 14, 2025
1 parent d6fbe07 commit f52e5b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions powermon/outputformats/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ def format(self, command, result: Result, device_info) -> list[str]:
icon = reading.icon
state_class = reading.state_class
device_class = reading.device_class
component = reading.definition.component
extra_info = ''
if icon:
extra_info += f"icon:{icon}, "
if state_class:
extra_info += f"state_class:{state_class}, "
if device_class:
extra_info += f"device_class:{device_class}"
if component:
extra_info += f"component:{component}"
_result.append(f"{name: <{max_data_name_length}} {value: <{max_data_value_length}} {unit: <{max_data_unit_length}} {extra_info}")

return _result

0 comments on commit f52e5b6

Please sign in to comment.