52 Commits
Author SHA1 Message Date
rickandCursor 8e02215f01 openspec: add Purpose sections to all five main specs
OpenSpec 1.16 requires ## Purpose; the specs predate that. Purposes are reconstructed from the 2026-04-13 greenfield proposal and the current requirements. Plain validation now passes 5/5; strict still flags two over-long requirements, tracked in PROJECT_HYGIENE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-08 12:11:15 +01:00
rickandCursor be00125465 openspec: archive add-french-translation, sync hacs-packaging spec
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 18:43:34 +01:00
rickandCursor 529894688b openspec(add-french-translation): apply progress (PR #14 commit, 0.4.6)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 18:36:01 +01:00
rickandCursor 2050051f66 openspec(add-french-translation): propose artifacts
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 18:35:09 +01:00
rickandCursor 851ec3a495 openspec: archive add-oktoberfest-keg-art
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:37:25 +01:00
rickandCursor 5e1f790420 openspec(add-oktoberfest-keg-art): ship without on-device check 4.1 (maintainer decision)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:36:07 +01:00
rickandCursor 7f7ac13fda openspec(add-oktoberfest-keg-art): apply progress (rename, card artwork, 0.4.5)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:35:35 +01:00
rickandCursor 88dc717833 openspec(add-oktoberfest-keg-art): propose artifacts
Issue #8: keg artwork for Löwenbräu (29745) and Spaten (33918) Oktoberfestbier on the card, and the integration's 29745 name spelled with umlauts. Joint 0.4.5 release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:32:48 +01:00
rickandCursor 89783da7af openspec: archive add-keg-48180, sync specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:26:10 +01:00
rickandCursor 8f2bced6ee openspec: archive fix-cognito-signin, sync specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:26:10 +01:00
rickandCursor 82062da60c openspec: archive add-keg-47792, sync specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:26:10 +01:00
rickandCursor 43f9410a21 openspec: sync integration and card versions at 0.4.4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:13:06 +01:00
rickandCursor b2016ce914 openspec(add-keg-48180): ship without on-device check 4.1 (maintainer decision)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:10:29 +01:00
rickandCursor 3a94f6c1cc openspec(add-keg-48180): apply progress (catalog, card 0.4.3)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:09:01 +01:00
rickandCursor b209de0cf2 openspec(fix-cognito-signin): ship without on-device checks (maintainer decision)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:04:18 +01:00
rickandCursor 7387bafc0b openspec(fix-cognito-signin): defer on-device checks 5.2-5.4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:01:26 +01:00
rickandCursor 064ee0992b openspec(fix-cognito-signin): 4.1 done, verified in Firefox and Chromium
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:59:09 +01:00
rickandCursor b0024c1b74 openspec(fix-cognito-signin): button-based token copy after prompt() truncation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:56:13 +01:00
rickandCursor 5ebdc2c3c1 openspec(fix-cognito-signin): single-command prompt() token handover
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:51:02 +01:00
rickandCursor 3fc7faac4e openspec(fix-cognito-signin): two-step README copy after Firefox test
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:48:45 +01:00
rickandCursor 98c1bd0622 openspec(fix-cognito-signin): config-flow tasks verified; hygiene notes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:27:38 +01:00
rickandCursor f8a9e069a2 openspec(fix-cognito-signin): 3.3 done
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:20:56 +01:00
rickandCursor a526af0088 openspec(fix-cognito-signin): apply progress; capture copy() before the promise
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:20:41 +01:00
rickandCursor a547afdfde openspec(fix-cognito-signin): don't claim #12/#13 already closed
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:04:01 +01:00
rickandCursor 7b4edbd390 openspec(add-keg-48180): propose artifacts
Catalog 48180 (Camden Stout, issue #9) in the integration and companion card, landing PR #10 and card PR #2 with the contributor credited; ships in the joint v0.3.5 / v0.4.3 release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:03:38 +01:00
rickandCursor ab206e65a4 openspec(fix-cognito-signin): propose artifacts
Sign in via Cognito InitiateAuth with the domain ClientMetadata PerfectDraft's PreAuthentication Lambda now requires (#11), and surface the server's rejection reason in the config flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 11:01:37 +01:00
rickandCursor 73ee49ef1d openspec(add-keg-47792): apply artifacts
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-26 07:18:48 +02:00
rickandCursor 2703328fb5 openspec(add-keg-47792): propose artifacts
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-26 07:08:17 +02:00
rickandCursor 4f82d9a4ac openspec(add-keg-48050): sync entities spec + archive
Ratchet the keg catalog floor to 115 to match the shipped 0.3.3
catalog. Archive the change that added Anheuser-Busch Bud (48050).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 15:09:02 +02:00
rick 94f45999fa openspec(backport-keg-catalog): sync entities spec + archive
Syncs the delta into openspec/specs/entities/spec.md, retrofitting the
Keg name sensor and Keg product ID sensor requirements that PR #2 shipped
without ever updating the spec, and adding both to the entity-name
translations scenario.

Note that openspec validate --specs still fails on all five spec files
for a missing "## Purpose" section. That is pre-existing and repo-wide,
not caused by this sync — verified by stashing the change and re-running.
Left alone rather than fixed across five files here.

PROJECT_HYGIENE learnings, three of them found while doing this work:

  - Never add a non-numeric key to keg_catalog.json. The loader's
    {int(k): v ...} raises on it and the except clause returns an empty
    dict, so the whole catalog dies silently at debug level. This is a
    trap precisely because embedding provenance in that file is the
    obvious next idea.

  - test_harness.py is stale: it reads a user_id key that
    .credentials.json no longer has, so it exits immediately.

  - All five openspec/specs files already fail validation, so a failing
    spec validation does not imply you broke something.

Group 5 (on-device) is recorded as verification debt rather than marked
done. The catalog was replaced wholesale and verified statically only;
the live resolve path is unexercised because no HA is reachable from the
dev host and the harness refresh token has expired. v0.3.2 exists so
that check can happen through HACS.
2026-09-06 16:26:28 +02:00
rick 3ddd4684e3 openspec(backport-keg-catalog): apply artifacts
Implementation is on agent/backport-keg-catalog. Groups 1-4 and 6.1-6.3
are done; group 5 (on-device) is blocked on the repo owner and the reason
is recorded in tasks.md.

Two artifact corrections that came out of the apply phase:

design.md now cherry-picks Brett's commit instead of copying the file.
The original decision rejected a cherry-pick on the assumption that the
pre-v0.1 merge-base would make it conflict. Wrong: 0982d20 touches one
file, and that file at 0982d20^ is byte-identical to master's, so only
the touched blob has to match and it applies clean. This is the better
option anyway — copying would have landed 28 observed keg names under the
committer's name with the author erased, whereas the cherry-pick keeps
Brett as author and carries the commit message that documents the
provenance and each of the four corrections.

design.md also records a trap found while writing the tests, because it
invalidates the provenance-marker idea the risks section suggested:
_load_keg_catalog builds {int(k): v ...} and catches ValueError by
returning {}, so adding a "_meta" or "_source" key to the catalog would
disable it entirely and leave every keg with no name, logged only at
debug level. Embedding metadata requires changing the loader first.
2026-09-06 16:19:53 +02:00
rickandCursor de326cb3ad openspec(filter-temperature-sentinels): sync entities spec + archive
Temperature sensor requirement now mandates rejecting out-of-range
firmware sentinels and reporting no value, with scenarios covering the
-128 case, the fallback chain, and non-numeric input.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 16:14:20 +02:00
rickandCursor c9c48a2160 openspec(filter-temperature-sentinels): apply artifacts
Implementation complete on agent/temperature-sentinel (133f708).
Sections 1-3 done, 4.1 and 4.3 done; 4.2 and 4.4 are public-repo
actions held for maintainer go-ahead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 16:11:11 +02:00
rickandCursor 34d112b1b3 openspec(filter-temperature-sentinels): propose artifacts
Sentinel temperature readings (-128, i.e. 0x80 as signed int8) from an
uninitialised probe are reported as real measurements and pollute
recorder statistics. Proposal, design, entities delta spec and tasks
for filtering them by plausible range.

Refs: Falkvinge/hassio-integration-perfectdraft-pro#4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 16:09:01 +02:00
rickandCursor 4c750c0f9f openspec(backport-keg-catalog): propose artifacts
Investigation of @brettjenkins' fork found exactly one substantive
difference from master in custom_components/: the keg name catalog, 86
entries against the fork's 114. keg_detection.py, sensor.py,
coordinator.py, api.py and const.py are byte-identical, and the
config_flow.py and translation differences are the fork lacking our
September reauth work. GitHub's "38 ahead / 46 behind" is an artifact of
the mirror's rewritten history — the merge-base predates v0.1.

The 28 missing IDs are kegs the PerfectDraft app can select, so they
render as a blank Keg sensor today. Four names we do ship are wrong
rather than merely styled differently, including one beer that no longer
exists under that name.

The change also retrofits the entities requirements for the Keg and Keg
Product sensors, which PR #2 shipped without touching
openspec/specs/entities/spec.md. That gap has to close here because the
catalog requirement has nothing to attach to otherwise.

Explicitly out of scope: the fork's hacs.json without the 2024.11.0
floor (that floor is ours, added by 0f3b4c2), the fork's 0.4.1 version
(0f3b4c2 renumbered to 0.3.1 deliberately), and changing what an
unmapped ID reports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 16:07:04 +02:00
rickandCursor 323e1daff0 openspec(fix-reauth-flow): archive completed change
Archived to openspec/changes/archive/2026-09-06-fix-reauth-flow.
Reauth confirmed working on the live machine running v0.3.1; three
non-blocking on-device checks archived unverified with reasons
recorded, and the keg-dependent one carried forward in
PROJECT_HYGIENE.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:57:37 +02:00
rickandCursor ac73071c11 openspec(fix-reauth-flow): record on-device verification outcome before archive
Reauth itself confirmed live on v0.3.1. Tasks 6.6, 6.7 and 8.8 archived
unverified: no keg was fitted, so there was no freshness baseline to
check, and the other two are cosmetic dialog-rendering checks already
covered by tests. The keg-dependent check is carried into
PROJECT_HYGIENE.md as verification debt for the next keg change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:57:29 +02:00
rickandCursor bffaa8deec openspec(fix-reauth-flow): on-device reauth confirmed on v0.3.1
Live instance running the v0.3.1 release build: the reauth repair
appeared and the flow completed on "Re-authentication successful"
rather than the "already configured" dead-end. Tasks 6.4 and 6.5 done;
6.6 (polling/history/freshness baseline), 6.7 and 8.8 still open.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:55:36 +02:00
rickandCursor 913490389f openspec(fix-reauth-flow): verification follow-up tasks + spec update
Records section 8 (the already_in_progress finding and its fix) and
renames the translation requirement to cover every abort reason, with
scenarios for the concurrent-flow path and source-derived enumeration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:39:27 +02:00
rickandCursor f124b46f0a openspec(fix-reauth-flow): apply tasks complete + sync config-flow spec
Marks sections 1-5 and the automated verification in 6 done, syncs the
config-flow delta into the main specs, and records the deferred
Cognito-token-persistence item in PROJECT_HYGIENE.md.

Archive (7.5/7.6) is deliberately held until on-device verification
(6.4-6.7) confirms the fix against the live machine.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:27:36 +02:00
rickandCursor 4ff26f6e7b openspec(fix-reauth-flow): propose artifacts
Reauth aborts with already_configured because async_step_token calls
_abort_if_unique_id_configured() on every source, including reauth where
a matching unique ID is the expected condition. Fresh tokens are discarded
and the entry stays broken.

Artifacts cover the source-aware fix, the 2024.11 core floor the reauth
helpers require, and the pytest-homeassistant-custom-component harness
needed to regression-test a config flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:13:18 +02:00
rickandCursor d3d5bffb13 openspec(improve-keg-change-detection): archive completed change
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 21:22:46 +02:00
rickandCursor 43d9a3e818 openspec(improve-keg-change-detection): on-device verified + sync specs
Task 5.3 confirmed on-device (Mark Keg Changed button and volume-jump
detection both work). Applied the entities delta to the main spec: the
keg freshness sensor now documents the volume-jump triggers and
last_volume restore, plus the new Manual keg-change button requirement.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 21:22:36 +02:00
rickandCursor ce70e3116b openspec(improve-keg-change-detection): mark apply tasks complete
Implementation merged. 16/17 done; 5.3 (manual on-device verification)
left for post-release HACS install.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 21:06:40 +02:00
rickandCursor ac7100b5c7 openspec(improve-keg-change-detection): propose artifacts
Propose smarter keg-change detection plus a manual override.
Detection gains two volume-based triggers (refill to near-full;
>=50-point upward jump) so a swap is caught even when pours never
resets to 0 (the swap-then-immediate-pour case). Adds a "Mark Keg
Changed" button as a deterministic fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 20:12:19 +02:00
rick 73559b7bd2 Write comprehensive main specs from scratch
5 capability specs covering the integration as-built:
- api-client: sign-in, Cognito refresh, auto-retry, endpoints
- config-flow: credentials, token paste, reauth, options flow
- data-coordinator: single poller, dynamic interval, error handling
- entities: 9 sensors (temp, keg %, freshness, connection, door,
  pours, last pour, firmware, mode), device model, translations
- hacs-packaging: repo structure, manifest, brand icon, README,
  GitHub mirror, translation constraints

331 lines of testable requirements with scenarios.

Made-with: Cursor
2026-04-18 15:41:29 +02:00
rick 4b6d2da7c3 Archive v0.2 change (bugfix-polish-v02) — verified and deployed
Made-with: Cursor
2026-04-13 14:55:34 +02:00
rick 70882b939e v0.2.0: Fix token refresh, HACS compliance, brand icon, keg freshness
Critical fix:
- Cognito refresh now parses response with content_type=None
  (was crashing after 1hr when access token expired)

HACS compliance:
- Added README.md with full setup instructions including the
  token generation command
- Fixed manifest.json URLs to point at actual repo
- Version bumped to 0.2.0

Brand:
- Added brand/icon.png (PerfectDraft glass icon from official app)

New sensor:
- Keg Freshness: 30-day countdown from keg insertion, detected
  via numberOfPoursSinceStartup reset + kegVolume near full,
  persisted across restarts via RestoreEntity

Polish:
- Fixed MALFORMED_ARGUMENT in token step description
- Cleaner description referencing README for instructions

Made-with: Cursor
2026-04-13 12:12:43 +02:00
rick 80128e2031 openspec(bugfix-polish-v02): proposal, design, specs, and tasks
Made-with: Cursor
2026-04-13 11:53:36 +02:00
rick 6d5c3aef46 Archive v0.1 change (perfectdraft-integration) — exploration complete
Made-with: Cursor
2026-04-13 11:49:08 +02:00