mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2026-04-18 15:03:45 +00:00
add studiomode force-transition command
patch bump
This commit is contained in:
@@ -98,3 +98,26 @@ async def toggle(ctx: click.Context):
|
||||
async with create_task_group() as tg:
|
||||
tg.start_soon(conn.background_processing)
|
||||
tg.start_soon(_run)
|
||||
|
||||
|
||||
@studiomode.command()
|
||||
@click.pass_context
|
||||
async def force_transition(ctx: click.Context):
|
||||
"""Force a transition in studio mode."""
|
||||
|
||||
conn = ctx.obj["connection"]
|
||||
ts = TransitionsService(conn)
|
||||
|
||||
async def _run():
|
||||
current_state = await ts.get_model()
|
||||
if not current_state.studio_mode:
|
||||
conn.close()
|
||||
raise click.Abort(click.style("Studio mode is not enabled.", fg="red"))
|
||||
|
||||
await ts.execute_studio_mode_transition()
|
||||
click.echo("Forced studio mode transition.")
|
||||
conn.close()
|
||||
|
||||
async with create_task_group() as tg:
|
||||
tg.start_soon(conn.background_processing)
|
||||
tg.start_soon(_run)
|
||||
|
||||
Reference in New Issue
Block a user