1
1
#
2
- # uchroma - Copyright (C) 2017 Steve Kondik
2
+ # uchroma - Copyright (C) 2021 Stefanie Kondik
3
3
#
4
4
# This program is free software: you can redistribute it and/or modify it
5
5
# under the terms of the GNU Lesser General Public License as published
@@ -295,7 +295,7 @@ def _ensure_open(self) -> bool:
295
295
296
296
297
297
def get_report (self , command_class : int , command_id : int , data_size : int ,
298
- * args , transaction_id : None , remaining_packets : int = 0x00 ) -> RazerReport :
298
+ * args , transaction_id : int , remaining_packets : int = 0x00 ) -> RazerReport :
299
299
"""
300
300
Create and initialize a new RazerReport on this device
301
301
"""
@@ -305,6 +305,8 @@ def get_report(self, command_class: int, command_id: int, data_size: int,
305
305
else :
306
306
transaction_id = 0xFF
307
307
308
+ self .logger .debug ('Transaction id: %d quirks: %s' % (transaction_id , self .hardware .quirks ))
309
+
308
310
report = RazerReport (self , command_class , command_id , data_size ,
309
311
transaction_id = transaction_id ,
310
312
remaining_packets = remaining_packets )
@@ -325,7 +327,7 @@ def _get_timeout_cb(self):
325
327
326
328
327
329
def run_with_result (self , command : BaseCommand , * args ,
328
- transaction_id : int = 0xFF , delay : float = None ,
330
+ transaction_id : int = None , delay : float = None ,
329
331
remaining_packets : int = 0x00 ) -> bytes :
330
332
"""
331
333
Run a command and return the result
@@ -368,7 +370,7 @@ def run_report(self, report: RazerReport, delay: float = None) -> bool:
368
370
return report .run (delay = delay , timeout_cb = self ._get_timeout_cb ())
369
371
370
372
371
- def run_command (self , command : BaseCommand , * args , transaction_id : int = 0xFF ,
373
+ def run_command (self , command : BaseCommand , * args , transaction_id : int = None ,
372
374
delay : float = None , remaining_packets : int = 0x00 ) -> bool :
373
375
"""
374
376
Run a command
@@ -619,9 +621,9 @@ def fire_restore_prefs(self):
619
621
620
622
621
623
def __repr__ (self ):
622
- return "%s(name=%s, type=%s, product_id=0x%04x, index=%d)" % \
624
+ return "%s(name=%s, type=%s, product_id=0x%04x, index=%d, quirks=%s )" % \
623
625
(self .__class__ .__name__ , self .name , self .device_type .value ,
624
- self .product_id , self .device_index )
626
+ self .product_id , self .device_index , self . hardware . quirks )
625
627
626
628
627
629
def _device_open (self ):
0 commit comments