summaryrefslogtreecommitdiff
path: root/ui/control_panel.py
diff options
context:
space:
mode:
Diffstat (limited to 'ui/control_panel.py')
-rw-r--r--ui/control_panel.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/control_panel.py b/ui/control_panel.py
index 4db18e3..4c4f1fd 100644
--- a/ui/control_panel.py
+++ b/ui/control_panel.py
@@ -120,7 +120,11 @@ class ControlWidget(QFrame):
if self.registry and self.device_id and self.channel_id:
dev = self.registry.get_instance(self.device_id)
if dev:
- if dev.status not in (DeviceStatus.CONNECTED, DeviceStatus.SIMULATED):
+ ch = dev.get_channel(self.channel_id)
+ if ch is not None and not ch.enabled:
+ print(f"[Control] write_channel({self.channel_id}, {value}) skipped on "
+ f"{self.device_id} — channel is disabled")
+ elif dev.status not in (DeviceStatus.CONNECTED, DeviceStatus.SIMULATED):
print(f"[Control] write_channel({self.channel_id}, {value}) skipped on "
f"{self.device_id} — device status is {dev.status.value}, not connected")
else: