mirror of
https://github.com/alexgetmancom/miband-bot.git
synced 2026-07-19 20:20:14 +03:00
Add extended health metrics and trends UI
This commit is contained in:
@@ -16,7 +16,7 @@ from zoneinfo import ZoneInfo
|
||||
from .config import Settings
|
||||
|
||||
LOCAL_TZ = ZoneInfo("Europe/Moscow")
|
||||
EXPORT_TABLES = ["steps_daily", "sleep_daily", "sleep_stages", "heart_rate", "blood_oxygen", "stress"]
|
||||
EXPORT_TABLES = ["steps_daily", "sleep_daily", "sleep_stages", "heart_rate", "blood_oxygen", "stress", "calories_daily", "weight", "workouts"]
|
||||
|
||||
|
||||
@contextmanager
|
||||
@@ -113,6 +113,45 @@ def init_health_db(db_path: Path) -> None:
|
||||
)
|
||||
"""
|
||||
)
|
||||
cursor.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS calories_daily (
|
||||
date TEXT PRIMARY KEY,
|
||||
total_cal REAL,
|
||||
active_cal REAL,
|
||||
valid_stand_hours INTEGER,
|
||||
intensity_minutes INTEGER,
|
||||
last_sync INTEGER
|
||||
)
|
||||
"""
|
||||
)
|
||||
cursor.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS weight (
|
||||
timestamp INTEGER PRIMARY KEY,
|
||||
weight_kg REAL,
|
||||
bmi REAL,
|
||||
body_fat_pct REAL
|
||||
)
|
||||
"""
|
||||
)
|
||||
cursor.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS workouts (
|
||||
workout_id TEXT PRIMARY KEY,
|
||||
sport_type TEXT,
|
||||
start_time INTEGER,
|
||||
end_time INTEGER,
|
||||
duration_sec INTEGER,
|
||||
calories REAL,
|
||||
avg_hr INTEGER,
|
||||
max_hr INTEGER,
|
||||
min_hr INTEGER,
|
||||
watermark INTEGER,
|
||||
raw_json TEXT
|
||||
)
|
||||
"""
|
||||
)
|
||||
conn.commit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user