helpers.py
cli.helpers
¶
Helpers for CLI Interface.
Attributes¶
base_formatters
module-attribute
¶
base_formatters: dict[str, collections.abc.Callable] = {
"led_colour": ember_mug.formatting.format_led_colour,
"liquid_level": ember_mug.formatting.format_liquid_level,
}
Classes¶
CommandLoop
¶
Class to handle command loop.
Source code in ember_mug/cli/helpers.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
Functions¶
build_sub_rows
¶
build_sub_rows(
row: tuple[str, ...],
) -> dict[int, dict[int, str]]
Build a defaultdict of cells to pad for empty values.
Source code in ember_mug/cli/helpers.py
34 35 36 37 38 39 40 |
|
print_changes
¶
print_changes(
changes: list[ember_mug.data.Change],
metric: bool = True,
) -> None
Print changes.
Source code in ember_mug/cli/helpers.py
65 66 67 68 69 70 71 72 73 74 75 |
|
print_info
¶
print_info(mug: ember_mug.mug.EmberMug) -> None
Print all mug data.
Source code in ember_mug/cli/helpers.py
59 60 61 62 |
|
print_table
¶
print_table(data: list[tuple[str, ...]]) -> None
Print data in a nice little ASCII table.
Source code in ember_mug/cli/helpers.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
validate_mac
¶
validate_mac(value: str) -> str
Check if specified MAC Address is valid.
Source code in ember_mug/cli/helpers.py
27 28 29 30 31 |
|