Sound device is now configurable
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Pünkösd Marcell 2020-09-30 04:56:17 +02:00
parent 1292666b66
commit 9a6852c2c0
2 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ class SoundSensor(AbcSensor):
"""
def __init__(self):
BirbnetesIoTPlatformRecordDriver.init(config.SAMPLE_LENGTH)
BirbnetesIoTPlatformRecordDriver.init(config.SAMPLE_LENGTH, microphone=config.RECORD_DEVICE)
def getvalue(self) -> Optional[str]:
"""

View File

@ -20,6 +20,7 @@ TICK_INTERVAL = float(os.environ.get("TICK_INTERVAL", 0.4))
SAMPLE_LENGTH = float(os.environ.get("SAMPLE_LENGTH", 1))
ENEMY_SOUNDS = os.environ.get("ENEMY_SOUNDS", '/var/lib/birbnetes/enemy_sounds')
RECORD_DEVICE = os.environ.get("RECORD_DEVICE", 'default')
MQTT_HOSTNAME = os.getenv("GUARD_MQTT_HOSTNAME", "localhost")
MQTT_PORT = int(os.getenv("GUARD_MQTT_PORT", 1883))