helpers.py
cli.helpers
¶
Helpers for CLI Interface.
Attributes¶
base_formatters
module-attribute
¶
base_formatters: dict[str, Callable] = {
"led_colour": format_led_colour,
"liquid_level": format_liquid_level,
}
Classes¶
CommandLoop
¶
Class to handle command loop.
Source code in ember_mug/cli/helpers.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
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
33 34 35 36 37 38 39 |
|
print_changes
¶
print_changes(
changes: list[Change], metric: bool = True
) -> None
Print changes.
Source code in ember_mug/cli/helpers.py
64 65 66 67 68 69 70 71 72 73 74 |
|
print_info
¶
print_info(mug: EmberMug) -> None
Print all mug data.
Source code in ember_mug/cli/helpers.py
58 59 60 61 |
|
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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
validate_mac
¶
validate_mac(value: str) -> str
Check if specified MAC Address is valid.
Source code in ember_mug/cli/helpers.py
26 27 28 29 30 |
|