mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-07-21 04:11:46 +00:00
simplify group toggle
This commit is contained in:
parent
ac1071caaf
commit
8976e7e29c
@ -116,16 +116,13 @@ def toggle(ctx: typer.Context, scene_name: str, group_name: str):
|
|||||||
)
|
)
|
||||||
raise typer.Exit(code=1)
|
raise typer.Exit(code=1)
|
||||||
|
|
||||||
enabled = ctx.obj['obsws'].get_scene_item_enabled(
|
new_state = not group.get('sceneItemEnabled')
|
||||||
|
ctx.obj['obsws'].set_scene_item_enabled(
|
||||||
scene_name=scene_name,
|
scene_name=scene_name,
|
||||||
item_id=int(group.get('sceneItemId')),
|
item_id=int(group.get('sceneItemId')),
|
||||||
|
enabled=new_state,
|
||||||
)
|
)
|
||||||
|
|
||||||
if enabled.scene_item_enabled:
|
|
||||||
ctx.invoke(hide, ctx=ctx, scene_name=scene_name, group_name=group_name)
|
|
||||||
else:
|
|
||||||
ctx.invoke(show, ctx=ctx, scene_name=scene_name, group_name=group_name)
|
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def status(ctx: typer.Context, scene_name: str, group_name: str):
|
def status(ctx: typer.Context, scene_name: str, group_name: str):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user