settings: remove unused code and fix but in EQUALIZER setting
This commit is contained in:
parent
f38fbcf949
commit
afe04b9804
|
@ -1280,7 +1280,7 @@ class PackedRangeValidator(Validator):
|
||||||
def prepare_write(self, new_values):
|
def prepare_write(self, new_values):
|
||||||
if len(new_values) != self.count:
|
if len(new_values) != self.count:
|
||||||
raise ValueError(f"wrong number of values {new_values!r}")
|
raise ValueError(f"wrong number of values {new_values!r}")
|
||||||
for new_value in new_values:
|
for new_value in new_values.values():
|
||||||
if new_value < self.min_value or new_value > self.max_value:
|
if new_value < self.min_value or new_value > self.max_value:
|
||||||
raise ValueError(f"invalid value {new_value!r}")
|
raise ValueError(f"invalid value {new_value!r}")
|
||||||
bytes = self.write_prefix_bytes + b"".join(_int2bytes(new_values[n], self.bc, signed=True) for n in range(self.count))
|
bytes = self.write_prefix_bytes + b"".join(_int2bytes(new_values[n], self.bc, signed=True) for n in range(self.count))
|
||||||
|
|
|
@ -555,13 +555,6 @@ class ReportRate(_Setting):
|
||||||
choices_universe[7] = "7ms"
|
choices_universe[7] = "7ms"
|
||||||
choices_universe[8] = "8ms"
|
choices_universe[8] = "8ms"
|
||||||
|
|
||||||
class _rw_class(_FeatureRW): # no longer needed - set Onboard Profiles to disable
|
|
||||||
def write(self, device, data_bytes):
|
|
||||||
# Host mode is required for report rate to be adjustable
|
|
||||||
if _hidpp20.get_onboard_mode(device) != _hidpp20_constants.ONBOARD_MODES.MODE_HOST:
|
|
||||||
_hidpp20.set_onboard_mode(device, _hidpp20_constants.ONBOARD_MODES.MODE_HOST)
|
|
||||||
return super().write(device, data_bytes)
|
|
||||||
|
|
||||||
class validator_class(_ChoicesV):
|
class validator_class(_ChoicesV):
|
||||||
@classmethod
|
@classmethod
|
||||||
def build(cls, setting_class, device):
|
def build(cls, setting_class, device):
|
||||||
|
@ -594,18 +587,6 @@ class ExtendedReportRate(_Setting):
|
||||||
choices_universe[5] = "250us"
|
choices_universe[5] = "250us"
|
||||||
choices_universe[6] = "125us"
|
choices_universe[6] = "125us"
|
||||||
|
|
||||||
class _rw_class(_FeatureRW):
|
|
||||||
def read(self, device, data_bytes=b""):
|
|
||||||
# need connection type from device to get actual report rate
|
|
||||||
self.read_prefix = b"\x00" if device.receiver else b"\x01"
|
|
||||||
super().read(device, data_bytes)
|
|
||||||
|
|
||||||
def write(self, device, data_bytes):
|
|
||||||
# Host mode is required for report rate to be adjustable
|
|
||||||
if _hidpp20.get_onboard_mode(device) != _hidpp20_constants.ONBOARD_MODES.MODE_HOST:
|
|
||||||
_hidpp20.set_onboard_mode(device, _hidpp20_constants.ONBOARD_MODES.MODE_HOST)
|
|
||||||
return super().write(device, data_bytes)
|
|
||||||
|
|
||||||
class validator_class(_ChoicesV):
|
class validator_class(_ChoicesV):
|
||||||
@classmethod
|
@classmethod
|
||||||
def build(cls, setting_class, device):
|
def build(cls, setting_class, device):
|
||||||
|
|
Loading…
Reference in New Issue