Skip to content

Instantly share code, notes, and snippets.

@TakehikoShimojima
Created June 23, 2018 03:06
Show Gist options
  • Select an option

  • Save TakehikoShimojima/bdec4cc4f4b58154e069a16108bd0517 to your computer and use it in GitHub Desktop.

Select an option

Save TakehikoShimojima/bdec4cc4f4b58154e069a16108bd0517 to your computer and use it in GitHub Desktop.
def handleDiscovery(self, dev, isNewDev, isNewData):
if isNewDev or isNewData:
for (adtype, desc, value) in dev.getScanData():
if desc == 'Manufacturer' and value[0:4] == 'd502':
if value[4:6] != self.lastseq:
self.lastseq = value[4:6]
send2ambient(value[6:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment