1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-04 16:02:51 +01:00

fix: safely access device config

This commit is contained in:
2025-07-30 09:46:26 +02:00
parent 2c6db345d3
commit 3b850fa730

View File

@@ -172,7 +172,9 @@ class DeviceItem(ExpandableGroupFrame):
@SafeSlot(popup_error=True)
def _reload_config(self, *_):
self.set_display_config(self.dev[self.device]._config)
# Guard in case we attempt to reload config while a device is being removed/readded
if (dev := self.dev.get(self.device)) is not None:
self.set_display_config(dev._config)
def set_display_config(self, config_dict: dict):
"""Set the displayed information from a device config dict, which must conform to the