Skip to content

Commit 562b908

Browse files
committed
more profile and versioning fixes
1 parent f6fd862 commit 562b908

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openrgb/orgb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def set_mode(self, mode: Union[int, str, utils.ModeData]):
196196
mode = self.modes[mode]
197197
elif type(mode) == str:
198198
mode = next((m for m in self.modes if m.name.lower() == mode.lower()))
199-
data = mode.pack()
199+
data = mode.pack(self.comms._protocol_version)
200200
self.comms.send_header(
201201
self.id,
202202
utils.PacketType.RGBCONTROLLER_UPDATEMODE,
@@ -312,11 +312,11 @@ def save_profile(self, name: str, directory: str = ''):
312312
:param name: the name of the profile to save
313313
:param directory: what directory to save the profile in. Defaults to HOME/.config/OpenRGB
314314
'''
315-
self.get_device_info()
315+
self.update()
316316
if directory == '':
317317
directory = environ['HOME'].rstrip("/") + "/.config/OpenRGB"
318318
with open(f'{directory.rstrip("/")}/{name}.orp', 'wb') as f:
319-
f.write(utils.Profile([dev.data for dev in self.devices]).pack(0))
319+
f.write(utils.Profile([dev.data for dev in self.devices]).pack())
320320

321321
def update(self):
322322
'''

openrgb/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class RGBColor:
136136
green: int
137137
blue: int
138138

139-
def pack(self, version: int) -> bytearray:
139+
def pack(self, version: int = 0) -> bytearray:
140140
'''
141141
Packs itself into a bytearray ready to be sent to the SDK or saved in a profile
142142

0 commit comments

Comments
 (0)