From 22c87e3ad5f633bd69f09b903b4d6d9e023a60e6 Mon Sep 17 00:00:00 2001 From: lolouk44 Date: Wed, 9 Sep 2020 10:29:55 +0100 Subject: [PATCH] 0.1.0 --- mi-scale/CHANGELOG.md | 4 ++++ mi-scale/config.json | 2 +- mi-scale/src/Xiaomi_Scale.py | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mi-scale/CHANGELOG.md b/mi-scale/CHANGELOG.md index d8d63da..3bbbada 100644 --- a/mi-scale/CHANGELOG.md +++ b/mi-scale/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.1.10] - 2020-09-09 +### Changed +- Fixed issue with detection of boolean in MQTT_DISCOVERY (https://github.com/lolouk44/hassio-addons/issues/16 and https://github.com/lolouk44/xiaomi_mi_scale/issues/31) + ## [0.1.9] - 2020-09-08 ### Changed - Fixed typo in MQTT message following the **breaking change** to snake_case attributes in 0.1.8 diff --git a/mi-scale/config.json b/mi-scale/config.json index 822f650..1b29ca4 100644 --- a/mi-scale/config.json +++ b/mi-scale/config.json @@ -1,6 +1,6 @@ { "name": "Xiaomi Mi Scale", - "version": "0.1.9", + "version": "0.1.10", "slug": "xiaomi_mi_scale", "description": "Read weight measurements from Xiamomi scale via BLE", "url": "https://github.com/lolouk44/xiaomi_mi_scale_ha_add_on", diff --git a/mi-scale/src/Xiaomi_Scale.py b/mi-scale/src/Xiaomi_Scale.py index 3076e82..f3e2a24 100644 --- a/mi-scale/src/Xiaomi_Scale.py +++ b/mi-scale/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: