use match / case syntax
This commit is contained in:
parent
a4cc88fc61
commit
0af2dabf6b
1 changed files with 19 additions and 18 deletions
37
mixer.py
37
mixer.py
|
@ -161,29 +161,30 @@ def main():
|
|||
if args.command:
|
||||
print(f"Command: {args.command}")
|
||||
|
||||
if args.command == 'get_name_from_qu':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.get_name_from_qu(0)
|
||||
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':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.get_system_state()
|
||||
case 'get_system_state':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.get_system_state()
|
||||
|
||||
if args.command == 'shutdown':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.shutdown()
|
||||
case 'shutdown':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.shutdown()
|
||||
|
||||
if args.command == 'set_default_layer':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
# mixer.set_layer()
|
||||
case 'set_default_layer':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
# mixer.set_layer()
|
||||
|
||||
if args.command == 'watch':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.watch()
|
||||
case 'watch':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.watch()
|
||||
|
||||
if args.command == 'scene_recall':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.scene_recall(0)
|
||||
case 'scene_recall':
|
||||
mixer = Mixer(args.ip, MIXER_PORT)
|
||||
mixer.scene_recall(0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue