19 Commits
Author SHA1 Message Date
rickandCursor a79173a160 Keg artwork for Löwenbräu and Spaten Oktoberfestbier; version 0.4.5
Both entries were mapped by kegId (29745, 33918) but had no imagePath, so the card drew the generated silhouette. Images come from the PerfectDraft DE storefront, encoded to WebP like the existing art (800 px and the native 700 px). The reference snapshot is re-synced to integration commit 1598e7b0, which spells 29745 as Löwenbräu Oktoberfestbier. Issue #8 on the integration repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:35:16 +01:00
rickandCursor 73a814e266 Version 0.4.4, in step with the integration
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:12:44 +01:00
47ecbe1880 Add Camden Stout (48180) with keg artwork; release 0.4.3
Maps integration product ID 48180 to a camden-stout entry next to the
other Camden rows. Artwork is taken unchanged from card PR #2; ABV 4.0%
checked against Camden Town Brewery's own PerfectDraft listing. The
reference snapshot is re-synced to the integration commit that adds the
key (8b2c4418), and the stale lockfile is regenerated.

Co-authored-by: MThomas564 <mattraethomas97@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-07 12:08:48 +01:00
rickandCursor 788ae28c44 Map keg 47792 to Camden Eazy, reusing the existing keg artwork.
Product 47629 stays on the original Camden Eazy entry. The new row shares that graphic.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-26 07:16:34 +02:00
rickandCursor 203d0fd228 Map keg 48050 to the existing Anheuser-Busch Bud catalog entry
The card already had the DE/AT wrap and artwork; the integration now
reports that product ID, so the join can complete. Bump to 0.4.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 12:42:55 +02:00
rickandCursor 30138df1a5 Bind the beer override to the keg it corrects (v0.4.0)
Replaces the global beer_name override with beer_overrides, a map keyed
by the product ID the integration reports. An entry applies only while
that keg is tapped, so a correction retires itself on a keg swap — which
matters because a card cannot rewrite its own config and so could never
prune a stale entry.

beer_name is now ignored, joining beer_entity. That is what fixes the
reported symptom: cards configured before 0.3.0 all carry the key,
because the editor of that era always wrote it and getStubConfig seeded
it, and 0.3.1 promoted those dormant values into permanent overrides.
No migration is possible, since the old value records no product ID.

An applied override is now marked on the card with the name detection
resolved, so it can never be mistaken for a detection result. The editor
records corrections against the currently tapped keg and lists saved
entries so leftovers are visible and removable.

Verified against the built bundle in a browser with stubbed hass data:
the reported case, the keg-swap recurrence, unrecognised IDs, the no-keg
state, all five layouts, and a 0.4.0 config loading on the 0.3.1 bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 13:39:45 +02:00
rickandCursor 45f1e6f394 Release 0.3.1
Patch bump covering the device-change entity invalidation fix on top of the
0.3.0 auto-detection work.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 17:53:02 +02:00
rickandCursor 1452620f0a Invalidate resolved entities when the configured device changes
setConfig cached entity IDs for the first device it saw and never cleared
them, so picking a different device in the editor left the card reading the
previous device's sensors. Pre-existing, but _resolveEntities now stops
scanning once the full set is found, which made it easier to hit.

Surfaced by review of the auto-detect-gap-closure changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 17:49:08 +02:00
rickandCursor 1d0c014111 Close the auto-detection gaps: full keg ID coverage, honest fallbacks
Implements openspec/changes/auto-detect-gap-closure.

Catalog now covers all 114 product IDs the integration can report (was 57).
22 IDs mapped onto existing entries, unlocking 20 keg photos that already
shipped but were unreachable; 36 new entries added for beers the card did
not know. Product ID 48061 was mapped to the wrong beer -- it is Northern
Monk Faith, not A Little Faith -- so it now has its own entry.

Detection precedence is explicit: beer_name override, then product ID, then
reported keg name, then an honest no-keg state. Removes the fallback that
displayed Leffe Blonde whenever detection failed, and prefers the card's
curated name over the integration's product-listing name (12 labels).

beer_name returns as an optional override, empty by default, which also
un-orphans custom_beers. Cards on integrations without the keg sensors now
get told to update rather than shown a wrong beer. _resolveEntities no
longer latches on temperature alone.

Adds npm run check:catalog to catch upstream catalog drift, the root cause
of the original gap.

Hardware verification (tasks 8.1-8.3) still outstanding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 17:04:39 +02:00
Brett Jenkins 672a41a5df Auto-detect the tapped beer from the PerfectDraft integration
Matches the tapped keg against the integration's product-id sensor
first, falling back to name matching. Adds product-id mappings plus a
Bass catalog entry, and removes the now-redundant manual beer picker
and beer_entity/beer_name config options.
2026-07-05 00:50:41 +01:00
rickandCursor a2319363d6 Add selectable layouts, tiered fallback art, 16 keg images (v0.2.0)
- Five layouts selectable via `layout` config + editor dropdown:
  landscape (default, unchanged), portrait, compact, hero, vessel
- Width-tolerant emoji matrix: shrinks to fit narrow cards instead of
  overflowing (min-width:0, container-query emoji sizing, min_columns:1).
  Fixes the reported crop on narrow placements.
- New matrix knobs: `matrix_columns` (auto|N) and `max_matrix_width`
- Tiered visual fallback so every beer looks intentional:
  keg photo -> brewery logo -> generated palette-tinted keg silhouette
- 16 new keg photos sourced from regional PerfectDraft stores
  (BrewDog, Tiny Rebel, Thornbridge, Fuller's, Theakston, Peroni,
   Diebels, Haake-Beck, La Virgen, Stella Unfiltered, Bud Light,
   Tennent's, Leffe Ambrée, Hertog Jan Grand, Castelain Ch'ti)
- All keg images re-encoded to WebP @ <=800px: dist/kegs 19MB -> 2.1MB
- OpenSpec change: card-layouts-and-imagery (proposal/design/specs/tasks)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 21:09:25 +02:00
rick c086437ce5 Add 31 real keg images, 2 new beers, image fallback (v0.1.6)
- Wire imagePath for 31 newly downloaded keg product images
- Add Castelain Ch'ti Blonde and Hertog Jan Grand Pilsener entries
- Add onerror fallback on <img> to show letter initial if image fails
- Remove 18 stale placeholder images from dist/kegs/
- Bump CARD_VERSION, EDITOR_VERSION, and package.json to 0.1.6

Made-with: Cursor
2026-04-18 20:31:04 +02:00
rick 2134576537 Remove 51 placeholder images, keep 21 real keg photos (v0.1.5)
64 of 72 images were CDN placeholder JPEGs (10KB each) disguised
as PNGs. Replaced 8 originals with full-resolution versions and
found 13 additional real images using alternate CDN filenames.

Beers without images now fall back to color palette display instead
of showing a broken "Awaiting Image" placeholder.

21 beers with real product images, remainder use brand colors.

Made-with: Cursor
2026-04-18 19:56:52 +02:00
rick d1b64fd9c7 Emoji grid fills zone: stretch rows, bigger emojis (v0.1.4)
- Grid rows use 1fr to stretch vertically across full zone height
- Each glass is a flex container filling its grid cell
- Emoji font-size: min(7vw, 5em) — roughly 150% of previous
- Grid align-content: stretch instead of center

Made-with: Cursor
2026-04-18 19:45:56 +02:00
rick 6de5f6a960 Scale up elements, label zone to ~1/4 width (v0.1.3)
- Label zone: 1/4 width (was 1/3), keg zone gets 3/4
- Beer logo: flex-grows to fill space, 80% width
- Temperature: 3em, beer name: 1.6em, count label: 1.3em
- Emoji grid: min(4.5vw, 3.5em) auto-scales to fill zone
- All elements sized up for NSPanel Pro readability

Made-with: Cursor
2026-04-18 19:34:47 +02:00
rick 63be469bb2 Emoji grid with fixed slots, Leffe Noël alias (v0.1.2)
- Emoji grid now uses CSS Grid with fixed max-glass slots per size
  (e.g., 6x3 for 330mL). Empty slots shown as faded greyed-out emojis.
- Added Leffe Noël as alias for Leffe Winter (same beer, French name)
- Bumped editor version to 0.1.2

Made-with: Cursor
2026-04-18 19:07:44 +02:00
rick 6a1d9fd08f Add version marker to editor for debugging cache issues
Made-with: Cursor
2026-04-18 18:59:45 +02:00
rick c69f39450a Fix device discovery to use HA entity registry instead of entity ID patterns
Entity IDs don't contain "perfectdraft" — they use the user-chosen
device name (e.g., sensor.balcony_tap_1). The editor and card now
use hass.entities registry to find devices by platform === "perfectdraft"
and resolve sensors by their translation_key (temperature, keg_remaining,
keg_freshness) instead of entity ID suffixes.

Made-with: Cursor
2026-04-18 18:54:25 +02:00
rick 8a6cce3c9e Add dist/ to repo for HACS compatibility
HACS plugin repos need the built JS and assets accessible on the
default branch. Un-ignored dist/ and committed build output:
- dist/perfectdraft-card.js (51KB)
- dist/kegs/*.png (72 keg product images)

Made-with: Cursor
2026-04-18 18:40:13 +02:00