|
@@ -23,7 +23,7 @@ from stddlib import daemon
|
|
|
from Adafruit_LED_Backpack import SevenSegment
|
|
|
|
|
|
|
|
|
-PARSER = OptionParser(prog="stdd", version="%prog 0.9.2", add_help_option=True)
|
|
|
+PARSER = OptionParser(prog="stdd", version="%prog 0.9.6", add_help_option=True)
|
|
|
PARSER.add_option("-d", "--daemon", action="store_true", dest="daemon",
|
|
|
help="run stdd as daemon")
|
|
|
PARSER.add_option("-u", "--user", dest="user", help="define an unprivileged \
|
|
@@ -123,7 +123,7 @@ if OPTIONS.daemon:
|
|
|
" and group" + OPTIONS.group)
|
|
|
|
|
|
# Initialize the display object
|
|
|
-DISPLAY = SevenSegment.SevenSegment(CONFIG.hw_address)
|
|
|
+DISPLAY = SevenSegment.SevenSegment(address=int(CONFIG.hw_address))
|
|
|
LOGGER.debug("opened hardware address")
|
|
|
|
|
|
# Set the brightness according to the configuration
|
|
@@ -177,11 +177,12 @@ def main():
|
|
|
else:
|
|
|
position3 = str(minute)[0]
|
|
|
LOGGER.debug("writing time to display")
|
|
|
- DISPLAY.set_digit(0, int(position1))
|
|
|
- DISPLAY.set_digit(1, int(position2))
|
|
|
- DISPLAY.set_digit(3, int(position3))
|
|
|
- DISPLAY.set_digit(4, int(position4))
|
|
|
+ DISPLAY.set_digit(0, position1)
|
|
|
+ DISPLAY.set_digit(1, position2)
|
|
|
+ DISPLAY.set_digit(2, position3)
|
|
|
+ DISPLAY.set_digit(3, position4)
|
|
|
minute_written = minute
|
|
|
+ DISPLAY.write_display()
|
|
|
time.sleep(1)
|
|
|
|
|
|
if __name__ == "__main__":
|