Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
-o2 -2 meaning offset2 of -2 is now possible
  • Loading branch information
JsBergbau authored Apr 3, 2020
1 parent 491cf82 commit 81d76e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LYWSD03MMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def connect():
return p

# Main loop --------
parser=argparse.ArgumentParser()
parser=argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--device","-d", help="Set the device MAC-Address in format AA:BB:CC:DD:EE:FF",metavar='AA:BB:CC:DD:EE:FF')
parser.add_argument("--battery","-b", help="Get estimated battery level", metavar='', type=int, nargs='?', const=1)
parser.add_argument("--count","-c", help="Read/Receive N measurements and then exit script", metavar='N', type=int)
Expand Down Expand Up @@ -310,7 +310,7 @@ def connect():
bluepypid=re.findall(r'bluepy-helper\((.*)\)',pstree)[0] #Store the bluepypid, to kill it later
except IndexError: #Should normally occur because we're disconnected
logging.debug("Couldn't find pid of bluepy-helper")
if bluepypid is not 0:
if bluepypid == 0:
os.system("kill " + bluepypid)
logging.debug("Killed bluepy with pid: " + str(bluepypid))
os._exit(0)
Expand Down

0 comments on commit 81d76e7

Please sign in to comment.