async def check_audio_support() -> tuple[bool, bool, str]:
"""Check if ffmpeg is present (with/without libsoxr support)."""
# check for FFmpeg presence
- returncode, output = await check_output("ffmpeg -version")
+ returncode, output = await check_output(["ffmpeg", "-version"])
ffmpeg_present = returncode == 0 and "FFmpeg" in output.decode()
# use globals as in-memory cache
empty_queue(buffer)
# get current ntp and start cliraop
- _, stdout = await check_output(f"{self.cliraop_bin} -ntp")
+ _, stdout = await check_output(self.cliraop_bin, "-ntp")
start_ntp = int(stdout.strip())
wait_start = 1250 + (250 * len(sync_clients))
await asyncio.gather(
if platform.system() == "Darwin":
password_str = f":{password}" if password else ""
- mount_cmd = f'mount -t smbfs "//{username}:{password_str}@{server}/{share}{subfolder}" "{self.base_path}"' # noqa: E501
+ mount_cmd = [
+ "mount",
+ "-t",
+ "smbfs",
+ f"//{username}:{password_str}@{server}/{share}{subfolder}",
+ self.base_path,
+ ]
elif platform.system() == "Linux":
options = [
options += mount_options.split(",")
options_str = ",".join(options)
- mount_cmd = (
- f"mount -t cifs -o {options_str} "
- f'"//{server}/{share}{subfolder}" "{self.base_path}"'
- )
+ mount_cmd = [
+ "mount",
+ "-t",
+ "cifs",
+ "-o",
+ options_str,
+ f"//{server}/{share}{subfolder}",
+ self.base_path,
+ ]
else:
msg = f"SMB provider is not supported on {platform.system()}"
async def unmount(self, ignore_error: bool = False) -> None:
"""Unmount the remote share."""
- returncode, output = await check_output(f"umount {self.base_path}")
+ returncode, output = await check_output(["umount", self.base_path])
if returncode != 0 and not ignore_error:
self.logger.warning("SMB unmount failed with error: %s", output.decode())
action: [optional] action key called from config entries UI.
values: the (intermediate) raw values for config entries sent with the action.
"""
- returncode, output = await check_output("snapserver -v")
+ returncode, output = await check_output(["snapserver", "-v"])
snapserver_present = returncode == 0 and "snapserver v0.27.0" in output.decode()
return (
ConfigEntry(