mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2025-06-27 15:20:24 +01:00
add studiomode force-transition command
patch bump
This commit is contained in:
parent
560b88e949
commit
020f376010
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "slobs-cli"
|
||||
version = "0.7.1"
|
||||
version = "0.7.2"
|
||||
description = "A command line application for Streamlabs Desktop"
|
||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||
dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"]
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user