Browse Source

change hardware address keyword and adapt digit positions to the ones used by the currect Adfruit module, raise version number to 0.9.6 (closes #1)

Helmut Pozimski 7 years ago
parent
commit
c083c6a8e7
2 changed files with 13 additions and 6 deletions
  1. 6 0
      debian/changelog
  2. 7 6
      stdd

+ 6 - 0
debian/changelog

@@ -1,3 +1,9 @@
+stdd (0.9.6-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Helmut Pozimski <helmut@pozimski.eu>  Sat, 03 Dec 2016 20:08:00 +0100
+
 stdd (0.9.5-1) unstable; urgency=low
 
   * New upstream release

+ 7 - 6
stdd

@@ -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__":