use context manager in scene_rotate

other refactors
This commit is contained in:
onyx-and-iris
2022-10-24 22:42:46 +01:00
parent 27fd86efa5
commit b8b446f9bf
4 changed files with 29 additions and 27 deletions

View File

@@ -4,16 +4,15 @@ import obsws_python as obs
def main():
resp = cl.get_scene_list()
scenes = reversed(tuple(di.get("sceneName") for di in resp.scenes))
with obs.ReqClient() as client:
resp = client.get_scene_list()
scenes = [di.get("sceneName") for di in reversed(resp.scenes)]
for scene in scenes:
print(f"Switching to scene {scene}")
cl.set_current_program_scene(scene)
time.sleep(0.5)
for scene in scenes:
print(f"Switching to scene {scene}")
client.set_current_program_scene(scene)
time.sleep(0.5)
if __name__ == "__main__":
cl = obs.ReqClient()
main()