Commit Graph

218 Commits

Author SHA1 Message Date
dadaloop82 7be02c7174 chore(gateway): add .gitignore, remove build artifacts from git 2026-04-15 19:46:07 +00:00
dadaloop82 0a35e9e8b4 fix(gateway): add QN-KS food scale parser (QN/Yolanda FFF1 protocol)
The QN-KS sends 18-byte frames on FFF1 with opcode 0x10:
  [0x10][0x12=len][...][flags][weight_hi][weight_lo][...][crc]

Weight is u16BE at bytes 9-10 in grams (1g resolution).
Stable flag is bit 3 of byte[8] (0xF8=stable, 0xF0=settling).
Checksum = sum(bytes[0..16]) mod 256.

The generic parser was reading byte[1]=0x12=18 as '18 grams' (the
packet length field), which is why it always showed 18g.

Added parseQNFood() with CRC validation, detected before generic fallback.
Also added AE00/AE02 UUIDs (secondary notifiable service on QN-KS).
2026-04-15 19:45:48 +00:00
dadaloop82 690d5ecd18 fix(gateway): remove trailing junk from ScaleProtocol.kt causing build failure
The file had 6 lines of old code appended after the closing brace,
starting a second 'package' declaration that broke compilation.
2026-04-15 16:33:42 +00:00
dadaloop82 b606e2b361 feat(gateway): show app version in header + copy/share debug log
- Version label (e.g. v2.0.0 (6)) displayed in the app header
- Copy and Share buttons appear when debug panel is open
- Copy puts full log in clipboard, Share opens Android share sheet
2026-04-15 16:07:22 +00:00
dadaloop82 d839a7e267 feat(gateway): food scale only - remove all body scale code v2.0.0
BREAKING CHANGE: WeightReading now uses grams (Int) instead of weightKg (Float).
All body composition fields removed (fat%, BMI, muscle, water, bone, kcal, impedance).
WebSocket always sends {unit:'g', value:<grams>}.

- ScaleProtocol: removed QN, 1byone, Hesley, Renpho, Body Composition parsers
- ScaleProtocol: generic parser tries grams, 0.1g, 0.5g, cg, kg*100, oz*10 (1-15000g)
- BleScaleManager: food scale keyword scoring, demotes body scale devices
- BleScaleManager: simplified service discovery (SIG Weight, FFE0, FFF0, Acaia)
- MainActivity: always displays grams, no body composition UI
- GatewayWebSocketServer: publishWeight(grams: Int), always sends unit='g'
- Version bumped to 2.0.0 (versionCode=6)
2026-04-15 16:00:57 +00:00
dadaloop82 d03a4853b5 feat(gateway): food/kitchen scale support (arboleaf CK10G) v1.6.0
- Generic parser now supports food scale weight ranges (1g-15kg)
  with candidates for gram, 0.1g, and 0.5g divisors
- WebSocket sends grams (unit: 'g') for weights under 15kg
- MainActivity displays grams for food-scale readings
- Enhanced debug: raw byte dump on decode failure with index/decimal/hex
- versionCode=5, versionName=1.6.0
2026-04-15 15:49:12 +00:00
dadaloop82 71c49e2c82 fix(gateway): clean ScaleProtocol.kt - remove Unicode box-drawing chars and fix duplication
- Remove Unicode ─ characters from section comment dividers that caused
  Kotlin compiler parse error (line 191:83 Closing bracket expected)
- Use plain ASCII dashes in section comments
- Remove inline field comments from data class
- File was duplicated (672 lines), truncated to correct 316 lines
2026-04-15 15:27:06 +00:00
dadaloop82 d30e9e0aaa gateway v1.5.0: protocol-aware parsers, debug fix, auto-reconnect
BREAKING FIX: 'always 1.8 kg' — the old brute-force parseGeneric was
matching noise bytes. Replaced with protocol-specific parsers:

Protocol support (from openScale research):
  - Bluetooth SIG 0x2A9D/0x2A9C (standard weight/body composition)
  - QN/Yolanda/FITINDEX (opcode 0x10 weight, 0x12 scale info)
  - 1byone/Eufy (0xCF header, LE weight at bytes 3-4)
  - Hesley/YunChen (20-byte body composition frame)
  - Renpho proprietary (0x2E header on 0x2A9D)
  - Safe generic fallback (stricter: min 4 bytes, min 2kg, unstable)

Body composition fields: fat%, muscle%, water%, bone, BMR/kcal,
impedance — all displayed when available.

Debug panel fix: capped at 150 lines, UI updates throttled to 200ms
(was: unbounded StringBuilder updated on every BLE notification = freeze).

Auto-reconnect: saves last connected device MAC to SharedPreferences,
auto-starts scan on app launch and connects when saved device found.

GATT service discovery: now explicitly subscribes to QN (FFE0/FFE1)
and custom FFF0 (FFF4 or FFF1) characteristics in addition to
standard Weight Scale and Body Composition services.

ScaleProtocol state: resetState() called on new connection to reset
QN weight divisor (100 or 10, learned from 0x12 info frame).
2026-04-15 15:11:22 +00:00
dadaloop82 695ea19d5c gateway: UX improvements + debug mode v1.4.0
- Show device names from ScanRecord (fixes MAC-only display)
- Show 'Senza nome' for unnamed devices instead of hiding them
- Show proximity (Vicino/Medio/Lontano) instead of raw dBm
- Sort scan results: scale-likely devices first (keyword + UUID scoring)
- Add debug panel (toggle with 🐛 Debug button):
  shows GATT service map, raw hex bytes, parse attempts
- Expand parseGeneric: all 2-byte windows × 3 resolutions × LE+BE
  (adds 0.1f and big-endian candidates – common in cheap consumer scales)
- Log GATT services/characteristics after connection
- Log raw hex bytes on every characteristic notification
2026-04-15 13:15:44 +00:00
dadaloop82 4d972b824e fix: vacuum state in move-after-use modal + show all recipe ingredients in cooking mode
- showMoveAfterUseModal: add '🫙 Torna sotto vuoto' checkbox (default=previous state)
  only shown if item was vacuum sealed; confirmMoveAfterUse passes vacuum_sealed to API
- showRecipeMoveModal: same vacuum checkbox with wasVacuum default passed from ingredient
- confirmRecipeMove: passes vacuum_sealed to inventory_update
- PHP API: add vacuum_sealed to recipe ingredient enrichment
- renderCookingStep: remove step-text word filter; show ALL unused from_pantry
  ingredients at every cooking step (AI uses pronouns like 'tagliarla' instead of
  repeating the ingredient name, causing them to be invisible)
2026-04-15 11:05:23 +00:00
dadaloop82 0830b1b168 fix: remove BLE scan UUID filter to support non-standard scales (LePulse, etc)
Many consumer scales like LePulse FI2016LB don't advertise standard
Weight Scale (0x181D) or Body Composition (0x181B) service UUIDs.
Remove the scan filter so all BLE devices are discovered.
The GATT fallback already handles proprietary services.
2026-04-14 17:18:41 +00:00
dadaloop82 7ff7f56e0b fix: fix invalid XML in launcher foreground vector drawable latest 2026-04-14 16:54:11 +00:00
dadaloop82 2740be3bdf fix: add missing launcher icon resources (mipmap + adaptive icon) 2026-04-14 16:49:50 +00:00
dadaloop82 d1c46a0bcb fix: add gradle.properties with android.useAndroidX=true for APK build 2026-04-14 16:45:23 +00:00
dadaloop82 df9de2d257 ci: fix broken YAML - multiline notes had zero indentation breaking the literal block 2026-04-14 16:42:35 +00:00
dadaloop82 fb134128fe ci: trigger workflow with direct commit on main 2026-04-14 16:39:39 +00:00
dadaloop82 329eed5082 Merge branch 'develop' 2026-04-14 16:38:09 +00:00
dadaloop82 0a11214d3d ci: remove paths filter - run on every push to main to ensure APK is always built 2026-04-14 16:38:07 +00:00
dadaloop82 390221ed4c Merge branch 'develop' 2026-04-14 16:33:38 +00:00
dadaloop82 38d8fa7afe ci: fix workflow - use gradle directly instead of ./gradlew (wrapper jar not in repo) 2026-04-14 16:33:35 +00:00
dadaloop82 18af2e9ef4 Merge branch 'develop' 2026-04-14 16:31:59 +00:00
dadaloop82 3fcded1d9b ci: also trigger workflow on changes to the workflow file itself 2026-04-14 16:31:56 +00:00
dadaloop82 b7dd197944 Merge branch 'develop' 2026-04-14 16:29:12 +00:00
dadaloop82 9523b68fea ci: add GitHub Actions workflow to build & release Scale Gateway APK
- Add .github/workflows/build-scale-gateway.yml
  Triggers on push to main (evershelf-scale-gateway/** path filter)
  Builds debug APK with Gradle/JDK 17, renames to evershelf-scale-gateway.apk
  Creates/updates 'latest' GitHub Release so the direct download URL resolves
- Bump web app version v1.2.0 -> v1.3.0 (index.html)
- Bump Android versionCode 1->2, versionName 1.0.0->1.3.0 (app/build.gradle.kts)
2026-04-14 16:29:00 +00:00
dadaloop82 0893742f05 feat: add smart scale BLE gateway integration
- Add evershelf-scale-gateway/ Android app (Kotlin):
  - BLE scanning and GATT connection to smart scales
  - Supports BT SIG Weight Scale (0x181D), Body Composition (0x181B), and generic heuristic parser
  - WebSocket server on port 8765 (local LAN)
  - Real-time weight broadcasting to EverShelf browser client
- Add scale status indicator in header (green/orange/grey dot)
- Add Settings tab for scale configuration (URL, enable toggle, test, APK download link)
- Add 'Read from scale' button in Add/Use forms when unit is g or ml
- Add scale WebSocket client logic in app.js with auto-reconnect
- Fix recipe suggestion: expiry-prioritized ingredients now only injected into
  AI prompt when user explicitly selects 'Priorità Scadenze' or 'Zero Sprechi'
- Update README with smart scale section and website link
- Update all translations (it, en, de) with scale strings
2026-04-14 15:59:40 +00:00
dadaloop82 7fa8395e9e docs: move screenshots section to end of README, translate to English 2026-04-13 11:02:56 +00:00
dadaloop82 f2b518dd4b docs: move screenshots section to end of README, translate to English 2026-04-13 11:02:49 +00:00
dadaloop82 2f21be8829 docs: merge screenshots and README update from develop 2026-04-13 11:00:45 +00:00
dadaloop82 7e9ae24f88 docs: add 9 app screenshots to README and assets
- Add 9 curated screenshots to assets/img/screenshots/ covering all main features
- Update README with 3x3 screenshot table with Italian descriptions
- Anchor /screenshots/ gitignore rule so assets/img/screenshots/ is tracked
- Screenshots cover: dashboard, inventory, barcode scanner, recipe detail,
  recipes list, cooking mode, AI chat, shopping list, smart predictions
2026-04-13 11:00:25 +00:00
dadaloop82 0c6a07ee95 fix: preserve version badge during i18n translatePage
Move data-i18n to inner <span> so translatePage() with textContent
does not overwrite the sibling .header-version span.
2026-04-13 10:23:26 +00:00
dadaloop82 66b75b1537 Merge develop: v1.2.0 - EverShelf rebrand
Merging all changes from develop into main for v1.2.0 release:
- Project renamed from Dispensa Manager to EverShelf
- Contact email: evershelfproject@gmail.com
- All localStorage keys migrated: dispensa_* -> evershelf_*
- SQLite DB renamed: dispensa.db -> evershelf.db
- Docker/Apache resources renamed to evershelf
- Version badge added to app header
- App name updated in all translations (it, en, de)
- Asset version strings bumped to bust browser cache
- JS file truncation fix (safe Python-based replacements)
- CHANGELOG, manifest.json, OpenAPI spec updated for v1.2.0
v1.2.0
2026-04-13 10:21:28 +00:00
dadaloop82 874a242149 release: v1.2.0 - EverShelf rebrand + version badge
- Add v1.2.0 version badge to app header
- Update CHANGELOG with v1.2.0 entries
- Bump manifest.json version to 1.2.0
- Bump OpenAPI spec version to 1.2.0
2026-04-13 10:21:16 +00:00
dadaloop82 a1873d3f81 fix: bump asset versions to bust browser cache (20260413a)
After JS truncation and recovery, browsers may have cached the broken app.js.
Bumping ?v= query strings forces fresh download of app.js and style.css.
2026-04-13 10:18:56 +00:00
dadaloop82 c52a91e779 fix: restore app.js after sed truncation, update nav title to EverShelf
- Recover app.js from pre-rebrand commit and re-apply all substitutions safely
- Fix all localStorage keys: dispensa_* -> evershelf_* (settings, setup, lang)
- Fix TTS test strings: 'Dispensa Manager' -> 'EverShelf'
- Set nav.title to EverShelf in it/en/de translations and HTML fallback
- Fix JS syntax error (Unexpected end of input) that broke the site
- CI JavaScript Lint should now pass
2026-04-13 10:14:40 +00:00
dadaloop82 20f734d54a rebrand: rename project from Dispensa Manager to EverShelf
- Update app name across all files (manifest, index.html, README, docs)
- Update contact email to evershelfproject@gmail.com
- Rename Docker service/container/volume to evershelf
- Rename localStorage keys: dispensa_* → evershelf_*
- Rename SQLite DB reference: dispensa.db → evershelf.db
- Update SSH remote to dadaloop82/EverShelf
- Update Apache conf file name to evershelf.conf
- Update CI workflow Docker image/container names
- Update cron job example path
- Add data/dispensa.db to .gitignore to prevent accidental commit
2026-04-13 10:09:33 +00:00
dadaloop82 2ea0c68f2e Merge develop: offline browser TTS 2026-04-10 10:19:02 +00:00
dadaloop82 da962581c0 feat: offline browser TTS engine with voice selector
Add Web Speech API as alternative TTS engine (fully offline, no config needed).
- Engine selector in settings: 'browser' (offline) or 'server' (HTTP endpoint)
- Voice picker populated from speechSynthesis.getVoices(), Italian voices first
- Auto-selects Paola voice on macOS/iOS if available
- Rate and pitch sliders (0.5x-2x, 0-2)
- testTTS() and speakCookingStep() branch on selected engine
- Existing users with tts_url keep 'server' as default engine
2026-04-10 10:19:02 +00:00
dadaloop82 499552e4df Merge develop: fix wizard password check 2026-04-10 06:57:46 +00:00
dadaloop82 4b5979333e fix: use bring_password_set and gemini_key_set flags from server API
The server never exposes bring_password in plaintext (only bring_password_set).
Fix wizard to check the boolean flag instead of the empty string.
2026-04-10 06:57:46 +00:00
dadaloop82 c9b3eb01cc Merge develop: fix wizard server settings check 2026-04-10 06:55:40 +00:00
dadaloop82 82f147d8d5 fix: check server-side credentials before showing setup wizard steps
Bring! and Gemini keys stored in .env are now fetched from the server
before deciding which wizard steps to show. This prevents the wizard
from prompting for credentials that are already configured server-side.
2026-04-10 06:55:40 +00:00
dadaloop82 38866e3daf Merge develop: smart setup wizard 2026-04-10 06:53:03 +00:00
dadaloop82 ef654b9dfc feat: smart setup wizard - only prompts for missing settings
The wizard now detects which specific settings are missing and shows
only those steps. Existing configurations are preserved. If a future
feature adds a new required setting, it will automatically prompt for
just that one.
2026-04-10 06:53:03 +00:00
dadaloop82 0b863b1cad Merge develop: update roadmap 2026-04-10 06:08:32 +00:00
dadaloop82 d75b889d8e docs: update roadmap with completed features 2026-04-10 06:08:32 +00:00
dadaloop82 d66bdc146c Merge develop: fix Docker build 2026-04-10 06:07:16 +00:00
dadaloop82 faaae1eede fix: add libonig-dev dependency for mbstring in Dockerfile 2026-04-10 06:07:16 +00:00
dadaloop82 52efa719d3 Merge develop: v1.1.0 release v1.1.0 2026-04-10 06:03:22 +00:00
dadaloop82 d13f744aea feat: v1.1.0 - Docker, i18n, setup wizard, rate limiting, OpenAPI
New features:
- Docker support (Dockerfile + docker-compose.yml)
- GitHub Actions CI pipeline (PHP lint, JS lint, Docker build, i18n validation)
- Internationalization system with 3 languages (it, en, de) and 347 translation keys
- First-run setup wizard (4-step configuration)
- File-based API rate limiting (120/15/5 req/min tiers)
- OpenAPI 3.1.0 specification for all 43 API endpoints
- CONTRIBUTING.md with translation and development guide
- Screenshots directory placeholder

Modified:
- README.md: Docker badges, install instructions, translations section
- api/index.php: rate limiting middleware
- assets/js/app.js: i18n system, setup wizard, t() function
- assets/css/style.css: setup wizard styles
- index.html: data-i18n attributes, setup wizard overlay, language settings
- .gitignore: rate_limits exclusion
2026-04-10 06:03:11 +00:00
dadaloop82 e0956c6043 Prepare for public distribution v1.0.0
- Remove all personal data from source code (HA IP, JWT tokens)
- Move secrets to .env configuration (gitignored)
- Create .env.example template for new installations
- Add centralized env() helper, eliminate code duplication (~120 lines removed)
- Add input validation on inventory operations (quantity bounds, location whitelist)
- Remove sensitive credential exposure in API responses
- Remove database and runtime files from Git tracking
- Disable database push-to-GitHub backup (local-only backup now)
- Update .gitignore for distribution
- Add comprehensive README with installation guide
- Add CHANGELOG.md for version tracking
- Add MIT LICENSE
- Add author/license headers to all source files
- TTS defaults now empty (configured per-installation via .env)
v1.0.0
2026-04-10 05:24:27 +00:00