From c5226faa13a6287952fe3b31bcdc0e8e566c5f22 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 8 Apr 2016 11:24:02 -0700 Subject: [PATCH] getdarkmode --- dump.py | 1 + ilt1000.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/dump.py b/dump.py index 19fa7d5..084a045 100755 --- a/dump.py +++ b/dump.py @@ -37,6 +37,7 @@ LINES = [ ('Transmission', ilt.GetTransmissionPercent, '%'), ('Optical density', ilt.GetOpticalDensity, '%'), ('100% percent setting', ilt.Get100PercentVoltage, 'V'), + ('Dark mode', lambda: ilt.DARK_NAMES[ilt.GetDarkMode()], ''), ] diff --git a/ilt1000.py b/ilt1000.py index 88b6188..15fa21a 100755 --- a/ilt1000.py +++ b/ilt1000.py @@ -57,6 +57,16 @@ class Saturated(Error): 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 # if nothing else is attached. ttyUSB0 seems to be completely non-responsive. # We default to ttyUSB1 @@ -144,3 +154,6 @@ class ILT1000(object): # Spec says microvolts, but actual values appear to be in volts. ret = self._SendCommand('get100perc') return float(ret) + + def GetDarkMode(self): + return int(self._SendCommand('getdarkmode'))