Skip to content

Commit

Permalink
Improve list hardware components output and code for better readabili…
Browse files Browse the repository at this point in the history
…ty. (#1060)
  • Loading branch information
destogl authored Jun 20, 2023
1 parent dc01ae3 commit e14497e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ def main(self, *, args):

for idx, component in enumerate(hardware_components.component):
print(
f"Hardware Component {idx}\n\tname: {component.name}\n\ttype: {component.type}"
f"Hardware Component {idx+1}\n\tname: {component.name}\n\ttype: {component.type}"
)
if hasattr(component, "plugin_name"):
plugin_name = component.plugin_name
else:
plugin_name = f"{bcolors.WARNING}plugin name missing!{bcolors.ENDC}"

print(
f"\tplugin name: {plugin_name}\n\tstate: id={component.state.id} label={component.state.label}\n\tcommand interfaces"
f"\tplugin name: {plugin_name}\n"
f"\tstate: id={component.state.id} label={component.state.label}\n"
f"\tcommand interfaces"
)
for cmd_interface in component.command_interfaces:
if cmd_interface.is_available:
Expand Down

0 comments on commit e14497e

Please sign in to comment.