Skip to content
Snippets Groups Projects
Commit 7a370afa authored by Chris Pastl's avatar Chris Pastl
Browse files

fix: compare returned volume by regex

parent ed94c9bb
No related branches found
No related tags found
1 merge request!38Test cases for "src/aura_engine/core"
Pipeline #7982 failed
...@@ -27,6 +27,7 @@ set of channels with their own control options. ...@@ -27,6 +27,7 @@ set of channels with their own control options.
from __future__ import annotations from __future__ import annotations
import logging import logging
import re
import time import time
import confuse import confuse
...@@ -432,8 +433,10 @@ class Mixer: ...@@ -432,8 +433,10 @@ class Mixer:
playout_volume = str(int(volume) / 100) playout_volume = str(int(volume) / 100)
args = f"{channel.get_index()} {playout_volume}" args = f"{channel.get_index()} {playout_volume}"
message = self.client.exec(self.mixer_id, "volume", args) message = self.client.exec(self.mixer_id, "volume", args)
if not message.find(f"volume={volume}%"): search = re.search(r"volume=(\d+)", message).group(1)
msg = f"Error setting volume of channel {channel}: {message}" actual_volume = int(search)
if actual_volume != volume:
msg = f"Error setting volume of channel {channel} to {volume}%: {message}"
self.logger.error(SU.red(msg)) self.logger.error(SU.red(msg))
else: else:
self.update_channel_status(channel.index, message) self.update_channel_status(channel.index, message)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment