Update README, MIGRATION.md, and CLAUDE.md for current feature set

This commit is contained in:
2026-04-15 03:55:14 -05:00
parent 75d0e05f59
commit 8721254476
3 changed files with 85 additions and 3 deletions
+4
View File
@@ -53,6 +53,10 @@ journalctl --user -u battery-tracker -f
- Unretire: sets status back to `available`
- Unassign with `next` form field → redirects to that URL (must start with `/`); falls back to dashboard
- Logging a charge entry → sets `battery.battery_percentage = 100`
- Retired batteries are excluded from `needs_attention` and `low_pct` warnings — both use the `active` list (`status in ("available", "installed")`); the template-side `low_pct` filter and the in-table ⚠ badge also guard against retired status
### Dashboard filtering
The dashboard route builds an `active` list (`status in ("available", "installed")`) used for all warning logic. Client-side filtering uses `data-status` attributes on each table row and `applyFilters()` in JS. The default filter state is `"active"` (retired rows hidden on page load); the Reset button restores `"active"`, not an empty filter. Column visibility choices are stored in `localStorage`.
### Home Assistant integration (optional)
`ha_client.py` wraps the HA REST API (`GET /api/states/<entity_id>`). `ha_poller.py` runs a daemon thread started in `create_app` only when `HOMEASSISTANT_URL` and `HOMEASSISTANT_API_KEY` are set. The poller queries all `Device` rows with `ha_entity_id IS NOT NULL`, fetches the current percentage from HA, and writes it to `battery_percentage` on each installed battery in that device. The poller uses its own `sessionmaker` session (not the request-scoped `scoped_session`). When HA is not configured the app behaves exactly as before — all HA UI is gated on `ha_enabled` passed to templates.