From 816a2990b49b64a654a128b2ad024d344690675e Mon Sep 17 00:00:00 2001 From: lolouk44 Date: Wed, 9 Sep 2020 10:30:58 +0100 Subject: [PATCH] 0.1.10 --- src/Xiaomi_Scale.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Xiaomi_Scale.py b/src/Xiaomi_Scale.py index 3076e82..f3e2a24 100644 --- a/src/Xiaomi_Scale.py +++ b/src/Xiaomi_Scale.py @@ -162,6 +162,10 @@ except FileNotFoundError: MQTT_PREFIX = os.getenv('MQTT_PREFIX', 'miscale') TIME_INTERVAL = int(os.getenv('TIME_INTERVAL', 30)) MQTT_DISCOVERY = os.getenv('MQTT_DISCOVERY',True) + if MQTT_DISCOVERY.lower() in ['true', '1', 'y', 'yes']: + MQTT_DISCOVERY = True + else: + MQTT_DISCOVERY = False MQTT_DISCOVERY_PREFIX = os.getenv('MQTT_DISCOVERY_PREFIX','homeassistant') HCI_DEV = os.getenv('HCI_DEV', 'hci0')[-1] @@ -309,7 +313,7 @@ class ScanProcessor(): raise def main(): - if MQTT_DISCOVERY.lower() in ['true', '1', 'y', 'yes']: + if MQTT_DISCOVERY: discovery() BluetoothFailCounter = 0 while True: