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:
|
if args.command:
|
||||||
print(f"Command: {args.command}")
|
print(f"Command: {args.command}")
|
||||||
|
|
||||||
if args.command == 'get_name_from_qu':
|
match args.command:
|
||||||
mixer = Mixer(args.ip, MIXER_PORT)
|
case 'get_name_from_qu':
|
||||||
mixer.get_name_from_qu(0)
|
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 = Mixer(args.ip, MIXER_PORT)
|
||||||
mixer.get_system_state()
|
mixer.get_system_state()
|
||||||
|
|
||||||
if args.command == 'shutdown':
|
case 'shutdown':
|
||||||
mixer = Mixer(args.ip, MIXER_PORT)
|
mixer = Mixer(args.ip, MIXER_PORT)
|
||||||
mixer.shutdown()
|
mixer.shutdown()
|
||||||
|
|
||||||
if args.command == 'set_default_layer':
|
case 'set_default_layer':
|
||||||
mixer = Mixer(args.ip, MIXER_PORT)
|
mixer = Mixer(args.ip, MIXER_PORT)
|
||||||
# mixer.set_layer()
|
# mixer.set_layer()
|
||||||
|
|
||||||
if args.command == 'watch':
|
case 'watch':
|
||||||
mixer = Mixer(args.ip, MIXER_PORT)
|
mixer = Mixer(args.ip, MIXER_PORT)
|
||||||
mixer.watch()
|
mixer.watch()
|
||||||
|
|
||||||
if args.command == 'scene_recall':
|
case 'scene_recall':
|
||||||
mixer = Mixer(args.ip, MIXER_PORT)
|
mixer = Mixer(args.ip, MIXER_PORT)
|
||||||
mixer.scene_recall(0)
|
mixer.scene_recall(0)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue