reset adapter subroutine to ble
This commit is contained in:
1 parent
d4c8f2c629
commit
4622343bf3
1 file changed
+7
-1
+7
-1
@@ -18,6 +18,7 @@ provided for convenience.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import subprocess
|
||||||
import warnings, logging
|
import warnings, logging
|
||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
logging.getLogger('apscheduler').setLevel(logging.ERROR)
|
logging.getLogger('apscheduler').setLevel(logging.ERROR)
|
||||||
@@ -191,9 +192,14 @@ def read_data_sync(mac: str) -> Optional[SensorReading]:
|
|||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Original helper functions
|
# Other helper functions
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
|
def reset_adapter():
|
||||||
|
subprocess.run(["sudo", "rfkill", "block", "bluetooth"], check=True)
|
||||||
|
subprocess.run(["sudo", "rfkill", "unblock", "bluetooth"], check=True)
|
||||||
|
|
||||||
def sensor_data_query(mac_list: List[str]) -> List[dict]:
|
def sensor_data_query(mac_list: List[str]) -> List[dict]:
|
||||||
|
reset_adapter()
|
||||||
result = []
|
result = []
|
||||||
for mac in mac_list:
|
for mac in mac_list:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in new issue
Block a user