Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow data_dict to exclude drawer_name #3119

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/fanshow
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class FanShow(object):
elif status_lower == 'false':
status = 'Not OK'

table.append((data_dict[DRAWER_FIELD_NAME], data_dict[LED_STATUS_FIELD_NAME], name, speed, data_dict[DIRECTION_FIELD_NAME], presence, status,
drawer_name = data_dict[DRAWER_FIELD_NAME] if DRAWER_FIELD_NAME in data_dict else "N/A"
table.append((drawer_name, data_dict[LED_STATUS_FIELD_NAME], name, speed, data_dict[DIRECTION_FIELD_NAME], presence, status,
data_dict[TIMESTAMP_FIELD_NAME]))
if table:
print(tabulate(table, header, tablefmt='simple', stralign='right'))
Expand Down