use match / case syntax

This commit is contained in:
coon 2025-09-18 21:26:21 +02:00
parent a4cc88fc61
commit 0af2dabf6b

View file

@ -161,27 +161,28 @@ def main():
if args.command:
print(f"Command: {args.command}")
if args.command == 'get_name_from_qu':
match args.command:
case 'get_name_from_qu':
mixer = Mixer(args.ip, MIXER_PORT)
mixer.get_name_from_qu(0)
if args.command == 'get_system_state':
case 'get_system_state':
mixer = Mixer(args.ip, MIXER_PORT)
mixer.get_system_state()
if args.command == 'shutdown':
case 'shutdown':
mixer = Mixer(args.ip, MIXER_PORT)
mixer.shutdown()
if args.command == 'set_default_layer':
case 'set_default_layer':
mixer = Mixer(args.ip, MIXER_PORT)
# mixer.set_layer()
if args.command == 'watch':
case 'watch':
mixer = Mixer(args.ip, MIXER_PORT)
mixer.watch()
if args.command == 'scene_recall':
case 'scene_recall':
mixer = Mixer(args.ip, MIXER_PORT)
mixer.scene_recall(0)