mirror of
https://github.com/onyx-and-iris/slobs-cli.git
synced 2025-08-07 12:21:44 +00:00
Compare commits
3 Commits
0c5bbc114f
...
2a18b94b11
Author | SHA1 | Date | |
---|---|---|---|
2a18b94b11 | |||
409aa2333f | |||
80da58bd6f |
@ -5,16 +5,19 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
# [0.8.0] - 2025-06-12
|
# [0.8.3] - 2025-06-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- custom error class SlobsCliError.
|
- custom error class SlobsCliError.
|
||||||
|
- scene switch command: if the --preview flag is not passed and we're in studio mode then write a message to the user to indicate the transition is being forced.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- scene list now shows which scene is the current active scene.
|
- scene list now shows which scene is the current active scene.
|
||||||
- audio list now shows mute states.
|
- audio list now shows mute states.
|
||||||
|
- --id option added to scene and audio commands to show the source ID in the output
|
||||||
|
- by default this is no longer displayed
|
||||||
|
|
||||||
- erroneous paths now print error messages and return 1 instead of raising exceptions.
|
- erroneous paths now print error messages and return 1 instead of raising exceptions.
|
||||||
- unit tests updated to reflect the changes.
|
- unit tests updated to reflect the changes.
|
||||||
|
15
README.md
15
README.md
@ -73,12 +73,20 @@ Flags can be used to override environment variables.
|
|||||||
#### Scene
|
#### Scene
|
||||||
|
|
||||||
- list: List all available scenes.
|
- list: List all available scenes.
|
||||||
|
- flags:
|
||||||
|
|
||||||
|
*optional*
|
||||||
|
- --id: Include scene IDs in the output.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
slobs-cli scene list
|
slobs-cli scene list
|
||||||
```
|
```
|
||||||
|
|
||||||
- current: Show the currently active scene.
|
- current: Show the currently active scene.
|
||||||
|
- flags:
|
||||||
|
|
||||||
|
*optional*
|
||||||
|
- --id: Include scene IDs in the output.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
slobs-cli scene current
|
slobs-cli scene current
|
||||||
@ -88,7 +96,8 @@ slobs-cli scene current
|
|||||||
- flags:
|
- flags:
|
||||||
|
|
||||||
*optional*
|
*optional*
|
||||||
- --preview: Switch the preview scene only.
|
- --id: Include scene IDs in the output.
|
||||||
|
- --preview: Switch the preview scene.
|
||||||
- args: <scene_name>
|
- args: <scene_name>
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@ -150,6 +159,10 @@ slobs-cli record toggle
|
|||||||
#### Audio
|
#### Audio
|
||||||
|
|
||||||
- list: List all audio sources.
|
- list: List all audio sources.
|
||||||
|
- flags:
|
||||||
|
|
||||||
|
*optional*
|
||||||
|
- --id: Include audio source IDs in the output.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
slobs-cli audio list
|
slobs-cli audio list
|
||||||
|
69
pdm.lock
generated
69
pdm.lock
generated
@ -5,10 +5,10 @@
|
|||||||
groups = ["default", "dev"]
|
groups = ["default", "dev"]
|
||||||
strategy = ["inherit_metadata"]
|
strategy = ["inherit_metadata"]
|
||||||
lock_version = "4.5.0"
|
lock_version = "4.5.0"
|
||||||
content_hash = "sha256:6f29a16938942eb7911abc4c1505647bb80b5275cb45ac72f9166b53ae6c0ef1"
|
content_hash = "sha256:87714b892affeadd7dba57d9430f0af3dc46f50cc9d095942367e4fca103f61e"
|
||||||
|
|
||||||
[[metadata.targets]]
|
[[metadata.targets]]
|
||||||
requires_python = ">=3.10"
|
requires_python = ">=3.11"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyio"
|
name = "anyio"
|
||||||
@ -86,21 +86,6 @@ files = [
|
|||||||
{file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"},
|
{file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "exceptiongroup"
|
|
||||||
version = "1.3.0"
|
|
||||||
requires_python = ">=3.7"
|
|
||||||
summary = "Backport of PEP 654 (exception groups)"
|
|
||||||
groups = ["default", "dev"]
|
|
||||||
marker = "python_version < \"3.11\""
|
|
||||||
dependencies = [
|
|
||||||
"typing-extensions>=4.6.0; python_version < \"3.13\"",
|
|
||||||
]
|
|
||||||
files = [
|
|
||||||
{file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"},
|
|
||||||
{file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"},
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "filelock"
|
name = "filelock"
|
||||||
version = "3.18.0"
|
version = "3.18.0"
|
||||||
@ -206,7 +191,7 @@ files = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyslobs"
|
name = "pyslobs"
|
||||||
version = "2.0.4"
|
version = "2.0.5"
|
||||||
requires_python = ">=3.9"
|
requires_python = ">=3.9"
|
||||||
summary = "Python wrapper to StreamLabs Desktop API"
|
summary = "Python wrapper to StreamLabs Desktop API"
|
||||||
groups = ["default"]
|
groups = ["default"]
|
||||||
@ -214,8 +199,8 @@ dependencies = [
|
|||||||
"websocket-client",
|
"websocket-client",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "PySLOBS-2.0.4-py3-none-any.whl", hash = "sha256:c9cc8cd3f5f22800f23589ae0607d78d8c4257c7c6a9770d651c63a76f512784"},
|
{file = "pyslobs-2.0.5-py3-none-any.whl", hash = "sha256:b33d774dda484ffe48e63592a3cdf66c79f77d04947a6e8c8b6da58db13ab156"},
|
||||||
{file = "pyslobs-2.0.4.tar.gz", hash = "sha256:a1e855b62cf4dd1208131fd58d925022dde8f057e33a0cb4933fd55efee876c7"},
|
{file = "pyslobs-2.0.5.tar.gz", hash = "sha256:53cb083cbe71e37f3604ad0e5ca9712b3f26a29824ce0d437fd66e3d7937fee6"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -264,48 +249,6 @@ files = [
|
|||||||
{file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
|
{file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tomli"
|
|
||||||
version = "2.2.1"
|
|
||||||
requires_python = ">=3.8"
|
|
||||||
summary = "A lil' TOML parser"
|
|
||||||
groups = ["dev"]
|
|
||||||
marker = "python_version < \"3.11\""
|
|
||||||
files = [
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"},
|
|
||||||
{file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"},
|
|
||||||
{file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"},
|
|
||||||
{file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"},
|
|
||||||
{file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"},
|
|
||||||
{file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"},
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tox"
|
name = "tox"
|
||||||
version = "4.26.0"
|
version = "4.26.0"
|
||||||
@ -350,7 +293,7 @@ name = "typing-extensions"
|
|||||||
version = "4.14.0"
|
version = "4.14.0"
|
||||||
requires_python = ">=3.9"
|
requires_python = ">=3.9"
|
||||||
summary = "Backported and Experimental Type Hints for Python 3.9+"
|
summary = "Backported and Experimental Type Hints for Python 3.9+"
|
||||||
groups = ["default", "dev"]
|
groups = ["default"]
|
||||||
marker = "python_version < \"3.13\""
|
marker = "python_version < \"3.13\""
|
||||||
files = [
|
files = [
|
||||||
{file = "typing_extensions-4.14.0-py3-none-any.whl", hash = "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"},
|
{file = "typing_extensions-4.14.0-py3-none-any.whl", hash = "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "slobs-cli"
|
name = "slobs-cli"
|
||||||
description = "A command line application for Streamlabs Desktop"
|
description = "A command line application for Streamlabs Desktop"
|
||||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"]
|
dependencies = ["pyslobs>=2.0.5", "asyncclick>=8.1.8"]
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = "0.8.2"
|
__version__ = "0.8.3"
|
||||||
|
@ -12,8 +12,9 @@ def audio():
|
|||||||
|
|
||||||
|
|
||||||
@audio.command()
|
@audio.command()
|
||||||
|
@click.option("--id", is_flag=True, help="Include audio source IDs in the output.")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def list(ctx: click.Context):
|
async def list(ctx: click.Context, id: bool = False):
|
||||||
"""List all audio sources."""
|
"""List all audio sources."""
|
||||||
|
|
||||||
conn = ctx.obj["connection"]
|
conn = ctx.obj["connection"]
|
||||||
@ -30,8 +31,9 @@ async def list(ctx: click.Context):
|
|||||||
for source in sources:
|
for source in sources:
|
||||||
model = await source.get_model()
|
model = await source.get_model()
|
||||||
click.echo(
|
click.echo(
|
||||||
f"- {click.style(model.name, fg='blue')} (ID: {model.source_id}, "
|
f"- {click.style(model.name, fg='blue')} "
|
||||||
f"Muted: {click.style('✅', fg='green') if model.muted else click.style('❌', fg='red')})"
|
f"{f'ID: {model.source_id}, ' if id else ''}"
|
||||||
|
f"Muted: {click.style('✅', fg='green') if model.muted else click.style('❌', fg='red')}"
|
||||||
)
|
)
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ from .__about__ import __version__ as version
|
|||||||
version, "-v", "--version", message="%(prog)s version: %(version)s"
|
version, "-v", "--version", message="%(prog)s version: %(version)s"
|
||||||
)
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def cli(ctx: click.Context, domain: str, port: int, token: str | None):
|
async def cli(ctx: click.Context, domain: str, port: int, token: str):
|
||||||
"""Command line interface for Streamlabs Desktop."""
|
"""Command line interface for Streamlabs Desktop."""
|
||||||
ctx.ensure_object(dict)
|
ctx.ensure_object(dict)
|
||||||
config = ConnectionConfig(
|
config = ConnectionConfig(
|
||||||
|
@ -12,8 +12,9 @@ def scene():
|
|||||||
|
|
||||||
|
|
||||||
@scene.command()
|
@scene.command()
|
||||||
|
@click.option("--id", is_flag=True, help="Include scene IDs in the output.")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def list(ctx: click.Context):
|
async def list(ctx: click.Context, id: bool = False):
|
||||||
"""List all available scenes."""
|
"""List all available scenes."""
|
||||||
|
|
||||||
conn = ctx.obj["connection"]
|
conn = ctx.obj["connection"]
|
||||||
@ -32,10 +33,14 @@ async def list(ctx: click.Context):
|
|||||||
for scene in scenes:
|
for scene in scenes:
|
||||||
if scene.id == active_scene.id:
|
if scene.id == active_scene.id:
|
||||||
click.echo(
|
click.echo(
|
||||||
f"- {click.style(scene.name, fg='green')} (ID: {scene.id}) [Active]"
|
f"- {click.style(scene.name, fg='green')} "
|
||||||
|
f"{f'(ID: {scene.id})' if id else ''} [Active]"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
click.echo(f"- {click.style(scene.name, fg='blue')} (ID: {scene.id})")
|
click.echo(
|
||||||
|
f"- {click.style(scene.name, fg='blue')} "
|
||||||
|
f"{f'(ID: {scene.id})' if id else ''}"
|
||||||
|
)
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
@ -45,8 +50,9 @@ async def list(ctx: click.Context):
|
|||||||
|
|
||||||
|
|
||||||
@scene.command()
|
@scene.command()
|
||||||
|
@click.option("--id", is_flag=True, help="Include scene IDs in the output.")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def current(ctx: click.Context):
|
async def current(ctx: click.Context, id: bool = False):
|
||||||
"""Show the currently active scene."""
|
"""Show the currently active scene."""
|
||||||
|
|
||||||
conn = ctx.obj["connection"]
|
conn = ctx.obj["connection"]
|
||||||
@ -55,7 +61,8 @@ async def current(ctx: click.Context):
|
|||||||
async def _run():
|
async def _run():
|
||||||
active_scene = await ss.active_scene()
|
active_scene = await ss.active_scene()
|
||||||
click.echo(
|
click.echo(
|
||||||
f"Current active scene: {click.style(active_scene.name, fg='green')} (ID: {active_scene.id})"
|
f"Current active scene: {click.style(active_scene.name, fg='green')} "
|
||||||
|
f"{f'(ID: {active_scene.id})' if id else ''}"
|
||||||
)
|
)
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
@ -65,6 +72,7 @@ async def current(ctx: click.Context):
|
|||||||
|
|
||||||
|
|
||||||
@scene.command()
|
@scene.command()
|
||||||
|
@click.option("--id", is_flag=True, help="Include scene IDs in the output.")
|
||||||
@click.argument("scene_name", type=str)
|
@click.argument("scene_name", type=str)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--preview",
|
"--preview",
|
||||||
@ -72,7 +80,9 @@ async def current(ctx: click.Context):
|
|||||||
help="Switch the preview scene only.",
|
help="Switch the preview scene only.",
|
||||||
)
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
async def switch(ctx: click.Context, scene_name: str, preview: bool = False):
|
async def switch(
|
||||||
|
ctx: click.Context, scene_name: str, preview: bool = False, id: bool = False
|
||||||
|
):
|
||||||
"""Switch to a scene by its name."""
|
"""Switch to a scene by its name."""
|
||||||
|
|
||||||
conn = ctx.obj["connection"]
|
conn = ctx.obj["connection"]
|
||||||
@ -89,23 +99,29 @@ async def switch(ctx: click.Context, scene_name: str, preview: bool = False):
|
|||||||
await ss.make_scene_active(scene.id)
|
await ss.make_scene_active(scene.id)
|
||||||
if preview:
|
if preview:
|
||||||
click.echo(
|
click.echo(
|
||||||
f"Switched to scene: {click.style(scene.name, fg='blue')} (ID: {scene.id}) in preview mode."
|
f"Switched to preview scene: {click.style(scene.name, fg='blue')} "
|
||||||
|
f"{f'(ID: {scene.id}).' if id else ''}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
click.echo(
|
||||||
|
f"Switched to scene: {click.style(scene.name, fg='blue')} "
|
||||||
|
f"{f'(ID: {scene.id}).' if id else ''}"
|
||||||
|
)
|
||||||
await ts.execute_studio_mode_transition()
|
await ts.execute_studio_mode_transition()
|
||||||
click.echo(
|
click.echo(
|
||||||
f"Switched to scene: {click.style(scene.name, fg='blue')} (ID: {scene.id}) in active mode."
|
"Executed studio mode transition to make the scene active."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if preview:
|
if preview:
|
||||||
conn.close()
|
conn.close()
|
||||||
raise SlobsCliError(
|
raise SlobsCliError(
|
||||||
"Cannot switch to preview scene in non-studio mode."
|
"Cannot switch the preview scene in non-studio mode."
|
||||||
)
|
)
|
||||||
|
|
||||||
await ss.make_scene_active(scene.id)
|
await ss.make_scene_active(scene.id)
|
||||||
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')} "
|
||||||
|
f"{f'(ID: {scene.id}).' if id else ''}"
|
||||||
)
|
)
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user