init app
This commit is contained in:
@@ -6,8 +6,13 @@ import pandas as pd
|
||||
from argparse import ArgumentParser
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from config import MILLIS_UUID, WEIGHT_UUID
|
||||
|
||||
READING_TIME = 30
|
||||
|
||||
async def read_ble(reading_time=READING_TIME):
|
||||
device = await BleakScanner.find_device_by_name("Smaage")
|
||||
assert device is not None, "No device found"
|
||||
timestamps = []
|
||||
raw_weights = []
|
||||
|
||||
@@ -45,3 +50,11 @@ async def read_ble(reading_time=READING_TIME):
|
||||
print(df['weights'].describe())
|
||||
plt.plot(timestamps, raw_weights)
|
||||
plt.show()
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('-t', default=READING_TIME, type=int, help="reading time in sec")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
asyncio.run(read_ble(args.t))
|
||||
Reference in New Issue
Block a user