mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-21 18:20:01 +02:00
fix(bec_lib): exclude disabled devices in device filters
This commit is contained in:
parent
3979a1e5e2
commit
388baae9f1
@ -115,7 +115,7 @@ class DeviceContainer(dict):
|
|||||||
excluded_readout_priority = [
|
excluded_readout_priority = [
|
||||||
str(x.name).lower() for x in ReadoutPriority if x != readout_priority
|
str(x.name).lower() for x in ReadoutPriority if x != readout_priority
|
||||||
]
|
]
|
||||||
excluded_devices = []
|
excluded_devices = self.disabled_devices
|
||||||
for priority in excluded_readout_priority:
|
for priority in excluded_readout_priority:
|
||||||
excluded_devices.extend(self.get(dev) for dev in readout_priority_mod.get(priority, []))
|
excluded_devices.extend(self.get(dev) for dev in readout_priority_mod.get(priority, []))
|
||||||
|
|
||||||
|
@ -318,3 +318,9 @@ def test_device_config_update_callback(dm_with_devices):
|
|||||||
with mock.patch.object(dm, "parse_config_message") as parse_config_message:
|
with mock.patch.object(dm, "parse_config_message") as parse_config_message:
|
||||||
dm._device_config_update_callback(msg, parent=dm)
|
dm._device_config_update_callback(msg, parent=dm)
|
||||||
parse_config_message.assert_called_once_with(dev_config_msg)
|
parse_config_message.assert_called_once_with(dev_config_msg)
|
||||||
|
|
||||||
|
|
||||||
|
def test_disabled_device_not_in_monitored(dm_with_devices):
|
||||||
|
assert "motor1_disabled" in dm_with_devices.devices
|
||||||
|
monitored_devices = dm_with_devices.devices.monitored_devices()
|
||||||
|
assert "motor1_disabled" not in [dev.name for dev in monitored_devices]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user