Skip to content

Commit

Permalink
0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lolouk44 committed Oct 10, 2022
1 parent 43f9ee0 commit 6b87a04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## [0.3.5] - 2022-10-07
## [0.3.5] - 2022-10-10
### Added
- Added extra logging. Logging Level can be set from config file.
- Deprecated options MISCALE_VERSION, TIME_INTERVAL.
### Changed
- Restored HCI Settings

## [0.3.4] - 2022-10-05
### Changed
Expand Down
10 changes: 7 additions & 3 deletions src/Xiaomi_Scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def MQTT_publish(weight, unit, mitdatetime, hasImpedance, miimpedance):
MQTT_DISCOVERY_PREFIX = "homeassistant"
pass
try:
HCI_DEV = data["HCI_DEV"][-1]
HCI_DEV = data["HCI_DEV"].lower()
logging.debug(f"HCI_DEV read from config: {HCI_DEV}")
except:
HCI_DEV = "hci0"
Expand Down Expand Up @@ -336,7 +336,10 @@ def callback(device, advertising_data):
pass
pass

async with BleakScanner(callback) as scanner:
async with BleakScanner(
callback,
device=f"{HCI_DEV}"
) as scanner:
...
# Important! Wait for an event to trigger stop, otherwise scanner
# will stop immediately.
Expand All @@ -350,5 +353,6 @@ def callback(device, advertising_data):
logging.info(f"Initialization Completed, Waiting for Scale...")
try:
asyncio.run(main(MISCALE_MAC.lower()))
except:
except Exception as error:
logging.error(f"Unable to connect to Bluetooth: {error}")
pass

0 comments on commit 6b87a04

Please sign in to comment.