getdarkmode
This commit is contained in:
1
dump.py
1
dump.py
@@ -37,6 +37,7 @@ LINES = [
|
|||||||
('Transmission', ilt.GetTransmissionPercent, '%'),
|
('Transmission', ilt.GetTransmissionPercent, '%'),
|
||||||
('Optical density', ilt.GetOpticalDensity, '%'),
|
('Optical density', ilt.GetOpticalDensity, '%'),
|
||||||
('100% percent setting', ilt.Get100PercentVoltage, 'V'),
|
('100% percent setting', ilt.Get100PercentVoltage, 'V'),
|
||||||
|
('Dark mode', lambda: ilt.DARK_NAMES[ilt.GetDarkMode()], ''),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
13
ilt1000.py
13
ilt1000.py
@@ -57,6 +57,16 @@ class Saturated(Error):
|
|||||||
|
|
||||||
class ILT1000(object):
|
class ILT1000(object):
|
||||||
|
|
||||||
|
DARK_NONE = 0
|
||||||
|
DARK_FACTORY = 1
|
||||||
|
DARK_USER = 2
|
||||||
|
|
||||||
|
DARK_NAMES = {
|
||||||
|
0: 'None',
|
||||||
|
1: 'Factory',
|
||||||
|
2: 'User',
|
||||||
|
}
|
||||||
|
|
||||||
# ILT1000 presents two FTDI serial devices, which become ttyUSB0 and ttyUSB1
|
# ILT1000 presents two FTDI serial devices, which become ttyUSB0 and ttyUSB1
|
||||||
# if nothing else is attached. ttyUSB0 seems to be completely non-responsive.
|
# if nothing else is attached. ttyUSB0 seems to be completely non-responsive.
|
||||||
# We default to ttyUSB1
|
# We default to ttyUSB1
|
||||||
@@ -144,3 +154,6 @@ class ILT1000(object):
|
|||||||
# Spec says microvolts, but actual values appear to be in volts.
|
# Spec says microvolts, but actual values appear to be in volts.
|
||||||
ret = self._SendCommand('get100perc')
|
ret = self._SendCommand('get100perc')
|
||||||
return float(ret)
|
return float(ret)
|
||||||
|
|
||||||
|
def GetDarkMode(self):
|
||||||
|
return int(self._SendCommand('getdarkmode'))
|
||||||
|
|||||||
Reference in New Issue
Block a user