Created
June 23, 2018 02:17
-
-
Save TakehikoShimojima/1e3c3ddc0a359cc72e843d794f7a032e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def handleDiscovery(self, dev, isNewDev, isNewData): # スキャンハンドラー | |
| if isNewDev: # 新しいデバイスが見つかったら | |
| for (adtype, desc, value) in dev.getScanData(): # アドバタイズデーターを取り出し | |
| if desc == 'Short Local Name' and value == 'Env': # 「2JCIE-BL01」を見つけ | |
| if dev.addr in devs.keys(): | |
| return | |
| MSG('New %s %s' % (value, dev.addr)) | |
| devThread = EnvSensor(dev) # EnvSensorオブジェクトを生成し | |
| devs[dev.addr] = devThread | |
| devThread.start() # 起動する |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment