Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openrgb/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions openrgb/orgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,14 @@ def disconnect(self):
'''Disconnects from the OpenRGB SDK'''
self.comms.stop_connection()

def rescan(self):
'''
Rescans for devices

State-breaking, you must call :any:`OpenRGBClient.update` after rescan is complete in OpenRGB.
'''
self.comms.requestRescanDevices()

@property
def protocol_version(self):
'''The protocol version of the connected SDK server'''
Expand Down
1 change: 1 addition & 0 deletions openrgb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down