Skip to content

Commit

Permalink
device: remove extra debugging for backlight
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Feb 6, 2024
1 parent 9c4bbec commit fbad827
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions lib/logitech_receiver/hidpp20.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,28 +1132,13 @@ def __init__(self, device):
self.temp_supported = supported & 0x10
self.perm_supported = supported & 0x20
self.mode = (self.options >> 3) & 0x03
if _log.isEnabledFor(_DEBUG):
_log.debug(
'BACKLIGHT READ %x %x %x %x %x %x %x', self.mode, self.enabled, self.options, self.level, self.dho, self.dhi,
self.dpow
)

def write(self):
self.options = (self.options & 0x07) | (self.mode << 3)
if _log.isEnabledFor(_DEBUG):
_log.debug(
'BACKLIGHT WRITE %x %x %x %x %x %x %x', self.mode, self.enabled, self.options, self.level, self.dho, self.dhi,
self.dpow
)
level = self.level if self.mode == 0x3 else 0
data_bytes = _pack('<BBBBHHH', self.enabled, self.options, 0xFF, level, self.dho, self.dhi, self.dpow)
self.device.feature_request(FEATURE.BACKLIGHT2, 0x00) # for testing - remove later
try: # for testing - remove later
self.device.feature_request(FEATURE.BACKLIGHT2, 0x10, data_bytes)
except Exception as e: # for testing - remove later
self.device.feature_request(FEATURE.BACKLIGHT2, 0x00) # for testing - remove later
raise e # for testing - remove later
self.device.feature_request(FEATURE.BACKLIGHT2, 0x00) # for testing - remove later
self.device.feature_request(FEATURE.BACKLIGHT2, 0x10, data_bytes)


#
Expand Down

0 comments on commit fbad827

Please sign in to comment.