volume_status module: log available devices only on change
@@ -199,6 +199,7 @@ class Pamixer(Audio):
class Pactl(Audio):
def setup(self, parent):
# get available device number if not specified
+ self.detected_devices = {}
self.device_type = "source" if self.is_input else "sink"
self.device_type_pl = self.device_type + "s"
self.device_type_cap = self.device_type[0].upper() + self.device_type[1:]
@@ -263,7 +264,9 @@ class Pactl(Audio):
if len(parts) < 2:
continue
current_devices[parts[0]] = parts[1]
- # self.parent.py3.log(f"available {self.device_type_pl}: {current_devices}")
+ if current_devices != self.detected_devices:
+ self.detected_devices = current_devices
+ self.parent.py3.log(f"available {self.device_type_pl}: {current_devices}")
return current_devices
def get_volume(self):
