rename model variables

patch bump
This commit is contained in:
onyx-and-iris 2025-06-11 16:34:36 +01:00
parent 377a9df824
commit 37364e7243
7 changed files with 40 additions and 40 deletions

View File

@ -1 +1 @@
__version__ = "0.7.6" __version__ = "0.7.7"

View File

@ -19,8 +19,8 @@ async def start(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.recording_status != "offline" active = model.recording_status != "offline"
if active: if active:
conn.close() conn.close()
@ -45,8 +45,8 @@ async def stop(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.recording_status != "offline" active = model.recording_status != "offline"
if not active: if not active:
conn.close() conn.close()
@ -71,8 +71,8 @@ async def status(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.recording_status != "offline" active = model.recording_status != "offline"
if active: if active:
click.echo("Recording is currently active.") click.echo("Recording is currently active.")
@ -95,8 +95,8 @@ async def toggle(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.recording_status != "offline" active = model.recording_status != "offline"
if active: if active:
await ss.toggle_recording() await ss.toggle_recording()

View File

@ -19,8 +19,8 @@ async def start(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.replay_buffer_status != "offline" active = model.replay_buffer_status != "offline"
if active: if active:
conn.close() conn.close()
@ -44,8 +44,8 @@ async def stop(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.replay_buffer_status != "offline" active = model.replay_buffer_status != "offline"
if not active: if not active:
conn.close() conn.close()
@ -71,8 +71,8 @@ async def status(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.replay_buffer_status != "offline" active = model.replay_buffer_status != "offline"
if active: if active:
click.echo("Replay buffer is currently active.") click.echo("Replay buffer is currently active.")
else: else:

View File

@ -77,9 +77,9 @@ async def switch(ctx: click.Context, scene_name: str, preview: bool = False):
scenes = await ss.get_scenes() scenes = await ss.get_scenes()
for scene in scenes: for scene in scenes:
if scene.name == scene_name: if scene.name == scene_name:
current_state = await ts.get_model() model = await ts.get_model()
if current_state.studio_mode: if model.studio_mode:
await ss.make_scene_active(scene.id) await ss.make_scene_active(scene.id)
if preview: if preview:
click.echo( click.echo(
@ -104,13 +104,13 @@ async def switch(ctx: click.Context, scene_name: str, preview: bool = False):
click.echo( click.echo(
f"Switched to scene: {click.style(scene.name, fg='blue')} (ID: {scene.id}) in active mode." f"Switched to scene: {click.style(scene.name, fg='blue')} (ID: {scene.id}) in active mode."
) )
conn.close()
break break
else: else:
conn.close() conn.close()
raise click.ClickException( raise click.ClickException(
click.style(f"Scene '{scene_name}' not found.", fg="red") click.style(f"Scene '{scene_name}' not found.", fg="red")
) )
conn.close()
async with create_task_group() as tg: async with create_task_group() as tg:
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)

View File

@ -19,8 +19,8 @@ async def start(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.streaming_status != "offline" active = model.streaming_status != "offline"
if active: if active:
conn.close() conn.close()
@ -44,8 +44,8 @@ async def stop(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.streaming_status != "offline" active = model.streaming_status != "offline"
if not active: if not active:
conn.close() conn.close()
@ -69,8 +69,8 @@ async def status(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.streaming_status != "offline" active = model.streaming_status != "offline"
if active: if active:
click.echo("Stream is currently active.") click.echo("Stream is currently active.")
@ -92,8 +92,8 @@ async def toggle(ctx: click.Context):
ss = StreamingService(conn) ss = StreamingService(conn)
async def _run(): async def _run():
current_state = await ss.get_model() model = await ss.get_model()
active = current_state.streaming_status != "offline" active = model.streaming_status != "offline"
await ss.toggle_streaming() await ss.toggle_streaming()
if active: if active:

View File

@ -19,8 +19,8 @@ async def enable(ctx: click.Context):
ts = TransitionsService(conn) ts = TransitionsService(conn)
async def _run(): async def _run():
current_state = await ts.get_model() model = await ts.get_model()
if current_state.studio_mode: if model.studio_mode:
conn.close() conn.close()
raise click.Abort(click.style("Studio mode is already enabled.", fg="red")) raise click.Abort(click.style("Studio mode is already enabled.", fg="red"))
@ -42,8 +42,8 @@ async def disable(ctx: click.Context):
ts = TransitionsService(conn) ts = TransitionsService(conn)
async def _run(): async def _run():
current_state = await ts.get_model() model = await ts.get_model()
if not current_state.studio_mode: if not model.studio_mode:
conn.close() conn.close()
raise click.Abort(click.style("Studio mode is already disabled.", fg="red")) raise click.Abort(click.style("Studio mode is already disabled.", fg="red"))
@ -65,8 +65,8 @@ async def status(ctx: click.Context):
ts = TransitionsService(conn) ts = TransitionsService(conn)
async def _run(): async def _run():
current_state = await ts.get_model() model = await ts.get_model()
if current_state.studio_mode: if model.studio_mode:
click.echo("Studio mode is currently enabled.") click.echo("Studio mode is currently enabled.")
else: else:
click.echo("Studio mode is currently disabled.") click.echo("Studio mode is currently disabled.")
@ -86,8 +86,8 @@ async def toggle(ctx: click.Context):
ts = TransitionsService(conn) ts = TransitionsService(conn)
async def _run(): async def _run():
current_state = await ts.get_model() model = await ts.get_model()
if current_state.studio_mode: if model.studio_mode:
await ts.disable_studio_mode() await ts.disable_studio_mode()
click.echo("Studio mode disabled successfully.") click.echo("Studio mode disabled successfully.")
else: else:
@ -109,8 +109,8 @@ async def force_transition(ctx: click.Context):
ts = TransitionsService(conn) ts = TransitionsService(conn)
async def _run(): async def _run():
current_state = await ts.get_model() model = await ts.get_model()
if not current_state.studio_mode: if not model.studio_mode:
conn.close() conn.close()
raise click.Abort(click.style("Studio mode is not enabled.", fg="red")) raise click.Abort(click.style("Studio mode is not enabled.", fg="red"))

View File

@ -13,12 +13,12 @@ async def cleanup(conn: SlobsConnection):
await ss.remove_scene(scene.id) await ss.remove_scene(scene.id)
ss = StreamingService(conn) ss = StreamingService(conn)
current_state = await ss.get_model() model = await ss.get_model()
if current_state.streaming_status != "offline": if model.streaming_status != "offline":
await ss.toggle_streaming() await ss.toggle_streaming()
if current_state.replay_buffer_status != "offline": if model.replay_buffer_status != "offline":
await ss.stop_replay_buffer() await ss.stop_replay_buffer()
if current_state.recording_status != "offline": if model.recording_status != "offline":
await ss.toggle_recording() await ss.toggle_recording()
conn.close() conn.close()