settings: fix bug in backlight 2 durations
This commit is contained in:
parent
07c0d35f80
commit
7d6428a03b
|
@ -334,7 +334,7 @@ class Backlight2Duration(_Setting):
|
||||||
min_version = 3
|
min_version = 3
|
||||||
validator_class = _RangeV
|
validator_class = _RangeV
|
||||||
min_value = 1
|
min_value = 1
|
||||||
max_value = 120 # actual maximum is 2 hours
|
max_value = 600 # 10 minutes - actual maximum is 2 hours
|
||||||
validator_options = {"byte_count": 2}
|
validator_options = {"byte_count": 2}
|
||||||
|
|
||||||
class rw_class:
|
class rw_class:
|
||||||
|
@ -345,7 +345,7 @@ class Backlight2Duration(_Setting):
|
||||||
|
|
||||||
def read(self, device):
|
def read(self, device):
|
||||||
backlight = device.backlight
|
backlight = device.backlight
|
||||||
return _int2bytes(getattr(backlight, self.field), 2) * 5 # use seconds instead of 5-second units
|
return _int2bytes(getattr(backlight, self.field) * 5, 2) # use seconds instead of 5-second units
|
||||||
|
|
||||||
def write(self, device, data_bytes):
|
def write(self, device, data_bytes):
|
||||||
backlight = device.backlight
|
backlight = device.backlight
|
||||||
|
|
Loading…
Reference in New Issue