Skip to content

Commit

Permalink
Merge pull request drndos#3 from aqualx/master
Browse files Browse the repository at this point in the history
add optional iface parameter to btle
  • Loading branch information
drndos authored Dec 30, 2019
2 parents f6b6a61 + 7f673c7 commit 47b1a44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mikettle/mikettle.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MiKettle(object):
A class to control mi kettle device.
"""

def __init__(self, mac, product_id, cache_timeout=600, retries=3, token=None):
def __init__(self, mac, product_id, cache_timeout=600, retries=3, iface=None, token=None):
"""
Initialize a Mi Kettle for the given MAC address.
"""
Expand All @@ -72,13 +72,14 @@ def __init__(self, mac, product_id, cache_timeout=600, retries=3, token=None):
self.lock = Lock()

self._product_id = product_id
self._iface = iface
# Generate token if not supplied
if token is None:
token = MiKettle.generateRandomToken()
self._token = token

def connect(self):
self._p = Peripheral(self._mac)
self._p = Peripheral(deviceAddr=self._mac, iface=self._iface)
self._p.setDelegate(self)

def name(self):
Expand Down

0 comments on commit 47b1a44

Please sign in to comment.