sync
This commit is contained in:
@@ -38,6 +38,10 @@ def main():
|
|||||||
rm_parser.add_argument("path", type=str, help="Pfad der zu löschenden Datei/Ordner")
|
rm_parser.add_argument("path", type=str, help="Pfad der zu löschenden Datei/Ordner")
|
||||||
rm_parser.add_argument("-r", "--recursive", action="store_true", help="Ordnerinhalte rekursiv löschen")
|
rm_parser.add_argument("-r", "--recursive", action="store_true", help="Ordnerinhalte rekursiv löschen")
|
||||||
|
|
||||||
|
# Befehl: confirm
|
||||||
|
confirm_parser = subparsers.add_parser("confirm", help="Bestätigt die aktuell laufende Firmware")
|
||||||
|
|
||||||
|
reboot_parser = subparsers.add_parser("reboot", help="Startet den Buzzer neu")
|
||||||
# Argumente parsen
|
# Argumente parsen
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
config = load_config(args)
|
config = load_config(args)
|
||||||
@@ -56,10 +60,15 @@ def main():
|
|||||||
with BuzzerConnection(config) as conn:
|
with BuzzerConnection(config) as conn:
|
||||||
# 1. Immer die Info holen und anzeigen
|
# 1. Immer die Info holen und anzeigen
|
||||||
sys_info = info.execute(conn)
|
sys_info = info.execute(conn)
|
||||||
print(f"Buzzer Firmware: v{sys_info['app_version']} (Protokoll v{sys_info['protocol_version']})")
|
|
||||||
print(f"LittleFS Status: {sys_info['used_kb']:.1f} KB / {sys_info['total_kb']:.1f} KB belegt ({sys_info['percent_used']:.1f}%)")
|
|
||||||
print("-" * 55)
|
|
||||||
|
|
||||||
|
# Neu: Status auslesen und Farbe zuweisen (Grün für CONFIRMED, Gelb für UNCONFIRMED)
|
||||||
|
status = sys_info.get("image_status", "UNKNOWN")
|
||||||
|
status_color = "\033[32m" if status == "CONFIRMED" else "\033[33m"
|
||||||
|
|
||||||
|
# Neu: Die print-Anweisung enthält nun den formatierten Status
|
||||||
|
print(f"Buzzer Firmware: v{sys_info['app_version']} [{status_color}{status}\033[0m] (Protokoll v{sys_info['protocol_version']})")
|
||||||
|
print(f"LittleFS Status: {sys_info['used_kb']:.1f} KB / {sys_info['total_kb']:.1f} KB belegt ({sys_info['percent_used']:.1f}%)")
|
||||||
|
print("-" * 55)
|
||||||
# 2. Spezifisches Kommando ausführen
|
# 2. Spezifisches Kommando ausführen
|
||||||
if args.command == "ls":
|
if args.command == "ls":
|
||||||
print(f"Inhalt von '{args.path}':\n")
|
print(f"Inhalt von '{args.path}':\n")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
VERSION_MAJOR = 0
|
VERSION_MAJOR = 0
|
||||||
VERSION_MINOR = 1
|
VERSION_MINOR = 1
|
||||||
PATCHLEVEL = 0
|
PATCHLEVEL = 1
|
||||||
VERSION_TWEAK = 0
|
VERSION_TWEAK = 0
|
||||||
EXTRAVERSION = 0
|
EXTRAVERSION = 0
|
||||||
Reference in New Issue
Block a user