from bluepy.btle import DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print ("Discovered device "+dev.addr+" with RSSI="+str(dev.rssi))
        elif isNewData:
            print ("Received new data from", dev.addr)
from bluepy.btle import DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print ("Discovered device "+dev.addr+" with RSSI="+str(dev.rssi))
        elif isNewData:
            print ("Received new data from", dev.addr)