From 375213ba5582a3229ffc71eb3a7f8d08b28f7a2b Mon Sep 17 00:00:00 2001 From: Thanh <59661596+ThanhCN0@users.noreply.github.com> Date: Sun, 19 Oct 2025 19:12:44 -0400 Subject: [PATCH 1/2] Add rescan function --- openrgb/network.py | 6 ++++++ openrgb/orgb.py | 4 ++++ openrgb/utils.py | 1 + 3 files changed, 11 insertions(+) diff --git a/openrgb/network.py b/openrgb/network.py index 5850bd4..cccf90d 100644 --- a/openrgb/network.py +++ b/openrgb/network.py @@ -227,6 +227,12 @@ def requestPluginList(self): self.send_header(0, utils.PacketType.REQUEST_PLUGIN_LIST, 0) self.read() + def requestRescanDevices(self): + ''' + Sends the request to rescan devices + ''' + self.send_header(0, utils.PacketType.REQUEST_RESCAN_DEVICES, 0) + def send_header(self, device_id: int, packet_type: utils.PacketType, packet_size: int, release_lock: bool = True): ''' Sends a header to the SDK diff --git a/openrgb/orgb.py b/openrgb/orgb.py index 523e650..76be1d1 100644 --- a/openrgb/orgb.py +++ b/openrgb/orgb.py @@ -621,6 +621,10 @@ def disconnect(self): '''Disconnects from the OpenRGB SDK''' self.comms.stop_connection() + def rescan(self): + '''Rescans for devices''' + self.comms.requestRescanDevices() + @property def protocol_version(self): '''The protocol version of the connected SDK server''' diff --git a/openrgb/utils.py b/openrgb/utils.py index 7403495..24822c7 100644 --- a/openrgb/utils.py +++ b/openrgb/utils.py @@ -74,6 +74,7 @@ class PacketType(IntEnum): REQUEST_PROTOCOL_VERSION = 40 SET_CLIENT_NAME = 50 DEVICE_LIST_UPDATED = 100 + REQUEST_RESCAN_DEVICES = 140 REQUEST_PROFILE_LIST = 150 REQUEST_SAVE_PROFILE = 151 REQUEST_LOAD_PROFILE = 152 From 8657459a14af1b1cac83caeac05f2de5ce1da615 Mon Sep 17 00:00:00 2001 From: Thanh <59661596+ThanhCN0@users.noreply.github.com> Date: Mon, 20 Oct 2025 14:08:42 -0400 Subject: [PATCH 2/2] Add warning to rescan --- openrgb/orgb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openrgb/orgb.py b/openrgb/orgb.py index 76be1d1..c1a5436 100644 --- a/openrgb/orgb.py +++ b/openrgb/orgb.py @@ -622,7 +622,11 @@ def disconnect(self): self.comms.stop_connection() def rescan(self): - '''Rescans for devices''' + ''' + Rescans for devices + + State-breaking, you must call :any:`OpenRGBClient.update` after rescan is complete in OpenRGB. + ''' self.comms.requestRescanDevices() @property