|
@@ -34,7 +34,8 @@ class SwitchbotDevice:
|
|
|
|
|
|
"""Base Representation of a Switchbot Device."""
|
|
"""Base Representation of a Switchbot Device."""
|
|
|
|
|
|
- def __init__(self, mac, retry_count=DEFAULT_RETRY_COUNT, password=None) -> None:
|
|
+ def __init__(self, mac, retry_count=DEFAULT_RETRY_COUNT, password=None, interface=None) -> None:
|
|
|
|
+ self._interface = interface
|
|
self._mac = mac
|
|
self._mac = mac
|
|
self._device = None
|
|
self._device = None
|
|
self._retry_count = retry_count
|
|
self._retry_count = retry_count
|
|
@@ -49,7 +50,8 @@ class SwitchbotDevice:
|
|
try:
|
|
try:
|
|
_LOGGER.debug("Connecting to Switchbot...")
|
|
_LOGGER.debug("Connecting to Switchbot...")
|
|
self._device = bluepy.btle.Peripheral(self._mac,
|
|
self._device = bluepy.btle.Peripheral(self._mac,
|
|
- bluepy.btle.ADDR_TYPE_RANDOM)
|
|
+ bluepy.btle.ADDR_TYPE_RANDOM,
|
|
|
|
+ self._interface)
|
|
_LOGGER.debug("Connected to Switchbot.")
|
|
_LOGGER.debug("Connected to Switchbot.")
|
|
except bluepy.btle.BTLEException:
|
|
except bluepy.btle.BTLEException:
|
|
_LOGGER.debug("Failed connecting to Switchbot.", exc_info=True)
|
|
_LOGGER.debug("Failed connecting to Switchbot.", exc_info=True)
|