Skip to content

Commit

Permalink
fix git mess..
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed Feb 5, 2019
1 parent 1a48204 commit 3a9010e
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions resources/blead/devices/beewismartdoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
import logging
import globals
import struct
<<<<<<< HEAD
import datetime
from multiconnect import Connector
from notification import Notification
import binascii


=======

from multiconnect import Connector
from notification import Notification
>>>>>>> 8581cb04e3734102b8f2335f57aee295867b14a0

class BeeWiSmartDoor():
def __init__(self):
self.name = 'beewi smart door'
Expand Down Expand Up @@ -43,10 +40,6 @@ def parse(self,data,mac,name,manuf):
logging.debug('BeeWi PARSE: wrong frame ')
return action

<<<<<<< HEAD

=======
>>>>>>> 8581cb04e3734102b8f2335f57aee295867b14a0
def read(self,mac):
result={}
try:
Expand All @@ -56,8 +49,7 @@ def read(self,mac):
conn.connect()
if not conn.isconnected:
return
<<<<<<< HEAD


#check pairing state first
pairing = conn.readCharacteristic('0x3a') # check pairing state
if pairing:
Expand All @@ -77,19 +69,9 @@ def read(self,mac):
notification.subscribe(2)
else:
battery = ord(conn.readCharacteristic('0x25'))
result['battery'] = battery
logging.debug('BeeWi read Battery=' + str(battery))
=======
battery = bytearray(conn.readCharacteristic('0x25'))
notification = Notification(conn,BeeWiSmartDoor)
conn.writeCharacteristic('0x3A','00',response=True)
conn.writeCharacteristic('0x33','0100',response=True)
conn.writeCharacteristic('0x32','00',response=True)
conn.writeCharacteristic('0x42','0100',response=True)
conn.writeCharacteristic('0x2b','313930323034313535393033',response=True)
conn.writeCharacteristic('0x41','00000000',response=True)
#notification.subscribe(2)
result['battery'] = int(battery,16)
>>>>>>> 8581cb04e3734102b8f2335f57aee295867b14a0

result['id'] = mac
return result
except Exception,e:
Expand All @@ -98,11 +80,6 @@ def read(self,mac):

def handlenotification(self,conn,handle,data,action={}):
result={}
<<<<<<< HEAD
logging.debug('BeeWiiSmartDoor--Handle: '+str(ord(handle)))
=======
logging.debug('BeeWiiSmartDoor--Handle: '+str(hex(handle)))
>>>>>>> 8581cb04e3734102b8f2335f57aee295867b14a0


globals.COMPATIBILITY.append(BeeWiSmartDoor)

0 comments on commit 3a9010e

Please sign in to comment.