From 7421c2488eecf617539445524804407a503b27db Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 May 2026 21:53:08 +0300 Subject: [PATCH] docs: make Russian README the default --- README.md | 28 +++++++++++++------------ README_EN.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 README_EN.md diff --git a/README.md b/README.md index e09187a..9930138 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,17 @@ # miband-bot -Single-user Xiaomi Fitness sync service and Telegram bot. +Русский | [English](README_EN.md) -The bot stores Xiaomi Fitness health data in SQLite and exposes a Telegram menu for recent steps, sleep, heart rate, SpO2, trends, manual sync and CSV export. +Однопользовательский сервис синхронизации Xiaomi Fitness и Telegram-бот. -## First Run +Бот сохраняет данные здоровья из Xiaomi Fitness в SQLite и показывает в Telegram меню с шагами, сном, пульсом, SpO2, аналитикой, ручной синхронизацией и экспортом CSV. -1. Create `secrets.env` from the variables below. -2. Start Docker Compose. -3. Open the bot in Telegram and send `/start`. -4. The bot will show a Xiaomi login button. Confirm the login, then the bot saves `data/token_.json`, runs the first sync and opens the main menu. +## Первый запуск + +1. Создайте `secrets.env` с переменными ниже. +2. Запустите Docker Compose. +3. Откройте бота в Telegram и отправьте `/start`. +4. Бот покажет кнопку входа в Xiaomi. Подтвердите вход, после этого бот сохранит `data/token_.json`, запустит первую синхронизацию и откроет главное меню. ```env TELEGRAM_BOT_TOKEN=123456:telegram-token @@ -26,9 +28,9 @@ docker compose up -d --build docker compose logs -f fitness-bot ``` -Both services share `./data`. Sync runs are guarded by a file lock in that directory, so manual sync from Telegram and the daemon do not write SQLite/token files at the same time. +Оба сервиса используют общую папку `./data`. Синхронизация защищена файловым lock в этой папке, поэтому ручной sync из Telegram и daemon не пишут в SQLite/token одновременно. -## Local Checks +## Локальные проверки ```sh python3 -m venv .venv @@ -42,15 +44,15 @@ python3 -m venv .venv ## Runtime -Entrypoints kept for Docker compatibility: +Entrypoints сохранены для совместимости с Docker: ```sh python -u miband_sync.py python -u fitness_bot.py ``` -Secrets live in `secrets.env` and `data/token_.json`; do not commit them. Token files are written atomically with mode `0600`. +Секреты лежат в `secrets.env` и `data/token_.json`; не коммитьте их. Token-файлы записываются атомарно с правами `0600`. -## License +## Лицензия -This project is licensed under GNU GPL v3.0. The vendored `mi-fitness-python` SDK is kept under its own GPL v3.0 license in `mi-fitness-python/LICENSE`. +Проект распространяется под GNU GPL v3.0. Vendored SDK `mi-fitness-python` сохранён со своей GPL v3.0 лицензией в `mi-fitness-python/LICENSE`. diff --git a/README_EN.md b/README_EN.md new file mode 100644 index 0000000..351b174 --- /dev/null +++ b/README_EN.md @@ -0,0 +1,58 @@ +# miband-bot + +[Русский](README.md) | English + +Single-user Xiaomi Fitness sync service and Telegram bot. + +The bot stores Xiaomi Fitness health data in SQLite and exposes a Telegram menu for recent steps, sleep, heart rate, SpO2, trends, manual sync and CSV export. + +## First Run + +1. Create `secrets.env` from the variables below. +2. Start Docker Compose. +3. Open the bot in Telegram and send `/start`. +4. The bot will show a Xiaomi login button. Confirm the login, then the bot saves `data/token_.json`, runs the first sync and opens the main menu. + +```env +TELEGRAM_BOT_TOKEN=123456:telegram-token +TELEGRAM_ALLOWED_USER_ID=123456789 +SYNC_INTERVAL=900 +QUERY_DURATION=2 +ENABLE_FDS_SLEEP_DETAILS=true +``` + +## Docker + +```sh +docker compose up -d --build +docker compose logs -f fitness-bot +``` + +Both services share `./data`. Sync runs are guarded by a file lock in that directory, so manual sync from Telegram and the daemon do not write SQLite/token files at the same time. + +## Local Checks + +```sh +python3 -m venv .venv +.venv/bin/pip install -r requirements-dev.txt -e mi-fitness-python +.venv/bin/python -m py_compile fitness_bot.py miband_sync.py $(find miband_tracker -name '*.py' | sort) +.venv/bin/python -m pytest +.venv/bin/python -m pytest mi-fitness-python/tests/unit +.venv/bin/ruff check . +.venv/bin/python -m pip check +``` + +## Runtime + +Entrypoints kept for Docker compatibility: + +```sh +python -u miband_sync.py +python -u fitness_bot.py +``` + +Secrets live in `secrets.env` and `data/token_.json`; do not commit them. Token files are written atomically with mode `0600`. + +## License + +This project is licensed under GNU GPL v3.0. The vendored `mi-fitness-python` SDK is kept under its own GPL v3.0 license in `mi-fitness-python/LICENSE`.