reset adapter sleep after reset
This commit is contained in:
1 parent
4622343bf3
commit
e824226059
1 file changed
+2
@@ -19,6 +19,7 @@ provided for convenience.
|
||||
|
||||
import asyncio
|
||||
import subprocess
|
||||
import time
|
||||
import warnings, logging
|
||||
warnings.filterwarnings("ignore")
|
||||
logging.getLogger('apscheduler').setLevel(logging.ERROR)
|
||||
@@ -197,6 +198,7 @@ def read_data_sync(mac: str) -> Optional[SensorReading]:
|
||||
def reset_adapter():
|
||||
subprocess.run(["sudo", "rfkill", "block", "bluetooth"], check=True)
|
||||
subprocess.run(["sudo", "rfkill", "unblock", "bluetooth"], check=True)
|
||||
time.sleep(5)
|
||||
|
||||
def sensor_data_query(mac_list: List[str]) -> List[dict]:
|
||||
reset_adapter()
|
||||
|
||||
Reference in new issue
Block a user