From 1d586b353ed1ed5f8fe4902247739aa7850d9c21 Mon Sep 17 00:00:00 2001 From: IndyJoeA Date: Thu, 13 Jul 2017 20:37:16 -0400 Subject: [PATCH] Make buzzer GPIO an Int Fixes buzzer initialization errors --- modules/buzzer/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/buzzer/__init__.py b/modules/buzzer/__init__.py index 4fc5a9a..74a9ec6 100644 --- a/modules/buzzer/__init__.py +++ b/modules/buzzer/__init__.py @@ -13,12 +13,13 @@ class Buzzer(object): def __init__(self, gpio): try: cbpi.app.logger.info("INIT BUZZER NOW GPIO%s" % gpio) - self.gpio = gpio + self.gpio = int(gpio) GPIO.setmode(GPIO.BCM) - GPIO.setup(gpio, GPIO.OUT) + GPIO.setup(self.gpio, GPIO.OUT) self.state = True cbpi.app.logger.info("BUZZER SETUP OK") except Exception as e: + cbpi.app.logger.info("BUZZER EXCEPTION %s" % str(e)) self.state = False def beep(self):