Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b5e36ef1 | ||
|
|
45f1e6f394 | ||
|
|
1452620f0a | ||
|
|
1d0c014111 | ||
|
|
2d3c5c0faf | ||
|
|
d0748e7e4f | ||
|
|
672a41a5df |
@@ -10,15 +10,15 @@ Designed and optimised for the Sonoff NSPanel Pro 120 in landscape mode, but wor
|
||||
|
||||
- **Five layouts** — landscape, portrait, compact, hero, or single-vessel gauge; choose what fits your dashboard (defaults to landscape, so existing cards are unchanged)
|
||||
- **Beer emoji pictogram** — see how many glasses remain in your keg at a glance, in a grid that shrinks to fit narrow cards
|
||||
- **Built-in beer catalog** — 75+ PerfectDraft beers, 68 with real keg photos; brand-tinted fallback art for the rest so every beer looks intentional
|
||||
- **Automatic beer detection** — the card reads the tapped keg from the integration and shows the right beer on its own; nothing to select
|
||||
- **Built-in beer catalog** — every keg the integration can identify, 68 with real keg photos; brand-tinted fallback art for the rest so every beer looks intentional
|
||||
- **Glass size selector** — tap the emoji zone to choose between 250 mL, 330 mL, 500 mL, UK pint, or US pint
|
||||
- **Beer selector** — tap the label zone to pick your current beer from the catalog
|
||||
- **Freshness warnings** — escalating CSS-animated alerts as your keg approaches its 30-day expiry
|
||||
- **UI-driven configuration** — no YAML editing required; everything is set up through the visual card editor
|
||||
|
||||
## Requirements
|
||||
|
||||
- [PerfectDraft Pro integration](https://github.com/Falkvinge/hassio-integration-perfectdraft-pro) installed and configured
|
||||
- [PerfectDraft Pro integration](https://github.com/Falkvinge/hassio-integration-perfectdraft-pro) **0.4.0 or later**, installed and configured — the card reads the keg sensors added in that release
|
||||
- Home Assistant 2024.8 or later
|
||||
|
||||
## Installation
|
||||
@@ -44,20 +44,30 @@ Designed and optimised for the Sonoff NSPanel Pro 120 in landscape mode, but wor
|
||||
|
||||
1. Edit your dashboard → Add Card → search for "PerfectDraft Card"
|
||||
2. The editor auto-discovers your PerfectDraft device(s)
|
||||
3. Select your default beer and glass size
|
||||
4. Done!
|
||||
3. Pick your glass size and layout
|
||||
4. Done! The beer is detected automatically from the keg in your machine.
|
||||
|
||||
### Beer detection
|
||||
|
||||
The card identifies the tapped beer from the integration's keg sensors, matching
|
||||
on the keg's product ID first and its reported name second. When no keg is
|
||||
tapped, the card says so rather than showing a beer.
|
||||
|
||||
If your keg is not recognised, or is shown as the wrong beer, set **Beer
|
||||
override** in the card editor (or `beer_name` in YAML). That wins over detection.
|
||||
Reports of unrecognised kegs are welcome as issues — the fix is usually a
|
||||
one-line catalog addition.
|
||||
|
||||
### YAML reference (for power users)
|
||||
|
||||
```yaml
|
||||
type: custom:perfectdraft-card
|
||||
device_id: "perfectdraft_pro"
|
||||
beer_name: "Leffe Blonde"
|
||||
glass_size: 330
|
||||
layout: landscape # landscape | portrait | compact | hero | vessel
|
||||
# beer_name: "Leffe Blonde" # override auto-detection; normally leave unset
|
||||
# matrix_columns: auto # "auto" or a fixed number of emoji columns
|
||||
# max_matrix_width: "480px" # cap + centre the emoji grid on wide cards
|
||||
# beer_entity: sensor.perfectdraft_pro_keg_name # future: auto beer detection
|
||||
# custom_beers:
|
||||
# - name: "My Homebrew IPA"
|
||||
# brewery: "Home"
|
||||
@@ -70,10 +80,10 @@ layout: landscape # landscape | portrait | compact | hero | vess
|
||||
|
||||
| Action | What happens |
|
||||
|--------|-------------|
|
||||
| Tap the **left zone** (beer label) | Opens beer selection dialog |
|
||||
| Tap the **right zone** (emoji grid) | Opens glass size selection dialog |
|
||||
|
||||
Selections persist in your browser across page refreshes.
|
||||
The beer is detected rather than chosen, so the label zone is display-only. Your
|
||||
glass size choice persists in your browser across page refreshes.
|
||||
|
||||
## Layouts
|
||||
|
||||
@@ -108,6 +118,11 @@ The card reads these sensors from the PerfectDraft integration:
|
||||
| `*_temperature` | Beer temperature display |
|
||||
| `*_keg_remaining` | Glasses remaining calculation |
|
||||
| `*_keg_freshness` | Freshness warning system |
|
||||
| `*_keg_product` | Identifying the tapped beer (product ID match) |
|
||||
| `*_keg` | Identifying the tapped beer (name match fallback) |
|
||||
|
||||
The last two arrive with integration 0.4.0. If they are missing, the card tells
|
||||
you to update the integration instead of guessing at a beer.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Vendored
+62
-93
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-09-09
|
||||
@@ -0,0 +1,106 @@
|
||||
## Context
|
||||
|
||||
PR #1 established the auto-detection mechanism and the right division of responsibility between the two repos: the **integration owns product ID → beer name** (via its bundled `keg_catalog.json`), and the **card owns product ID → visual identity** (brand colours, keg photography, style metadata). That split is worth preserving — the card is not duplicating the name table, it is joining against it on product ID.
|
||||
|
||||
What went wrong is entirely on the card's side of that join. The card's `kegId` coverage was built against an 86-entry snapshot of the integration catalogue; the integration has since grown to 114 entries with cleaned-up names (`3c4b9ca6`). Half the join keys are missing, and the failure modes are unhelpful: an unmatched ID silently renders as either grey "Custom Beer" or, worse, as Leffe Blonde.
|
||||
|
||||
Two constraints shape the design. First, the card ships a pre-built `dist/perfectdraft-card.js` and has no test harness, so correctness has to come from a checkable data invariant rather than from unit tests. Second, the integration catalogue is upstream and will keep growing, so any fix that is a one-time hand-transcription will drift again.
|
||||
|
||||
The full hand-verified mapping for all 57 unmapped IDs, plus the 12 label divergences, is in [`keg-id-mapping.md`](./keg-id-mapping.md).
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
|
||||
- Every one of the 114 product IDs the integration can report resolves to a catalogue entry with sensible branding.
|
||||
- No unmapped or absent keg ever causes the card to display a beer that is not in the machine.
|
||||
- A user can override detection when it is wrong, without editing YAML by hand.
|
||||
- Mapping drift against the upstream catalogue becomes detectable rather than silent.
|
||||
- The 20 already-shipped keg photos that are currently unreachable become reachable.
|
||||
|
||||
**Non-Goals:**
|
||||
|
||||
- New keg photography for the 35 new catalogue entries. They use existing brand-tinted fallback art; adding photos is a separate content change.
|
||||
- Any modification to the integration. Its sensors and catalogue are treated as a fixed upstream contract.
|
||||
- Reinstating the in-card beer *picker* dialog. PR #1 was right that tapping the label to choose a beer is the wrong primary interaction once detection works; the override belongs in the config editor.
|
||||
- Auto-fetching the integration catalogue at runtime. The card must work with no extra network access and no assumptions about the integration's file layout.
|
||||
|
||||
## Decisions
|
||||
|
||||
### 1. Curated name wins the label whenever the product ID resolves
|
||||
|
||||
PR #1 chose `validName ?? live.name`, commented as "authoritative PerfectDraft name wins". The premise is wrong: the integration catalogue is closer to a product listing than a display name, carrying pack sizes and qualifiers ("Corona Cero (0.0% abv)", "Kopparberg Strawberry and Lime Cider"), and at the time PR #1 was written it also carried short-date and BBE strings.
|
||||
|
||||
Precedence becomes:
|
||||
|
||||
1. `beer_name` override, if set → resolve through the existing name/slug/custom path.
|
||||
2. Product ID match → curated catalogue entry, **curated name used verbatim**.
|
||||
3. No ID match but a usable reported name → generic palette carrying the reported name (existing `resolveBeer` behaviour).
|
||||
4. Nothing usable → explicit no-keg state.
|
||||
|
||||
The integration's name is still valuable at step 3, where it is the only information available. Rejected alternative: normalising the integration's names by stripping suffixes with regexes. That is a guessing game against upstream copy changes, and the card already has a curated name for exactly these IDs.
|
||||
|
||||
### 2. Explicit no-keg state instead of a catalogue-order fallback
|
||||
|
||||
`resolveBeer(undefined)` returning `getAllBeers()[0]` is a latent bug that PR #1 promoted into a reachable state. The fix is to stop calling `resolveBeer(undefined)` for the not-detected case and render a distinct state instead: neutral palette, no keg photo, and a label that says no keg is detected rather than naming a beer.
|
||||
|
||||
`resolveBeer(undefined)` itself changes to return the neutral `custom` fallback rather than the first catalogue entry, so the trap cannot be re-entered from a future call site. Rejected alternative: keeping the card blank. Temperature and freshness are still meaningful with no keg tapped, and an empty card looks broken.
|
||||
|
||||
### 3. `beer_name` returns as an override, not a default
|
||||
|
||||
The config key comes back with inverted semantics. It was the primary source of truth; it becomes a last-resort override that wins over detection when present. This keeps three things working that PR #1 broke: users with existing YAML, the `custom_beers` feature that is currently orphaned in the types with no reachable entry point, and any keg the catalogue does not know.
|
||||
|
||||
The editor gets an optional override field that is empty by default and labelled as an override, so the normal path stays zero-configuration. Rejected alternative: a `beer_overrides` map keyed by product ID. More precise, but it is a new config surface for a rare case, and it cannot help when the ID is unresolved.
|
||||
|
||||
### 4. Product-ID lookup gets an index
|
||||
|
||||
`getBeerByKegId` is currently `CATALOG.find(...)`, a linear scan on every render, in a module that already builds `slugIndex` and `nameIndex` at load. It becomes a third `Map` built in the same loop. Minor performance point, but the real motivation is that building the index is where duplicate `kegId` values become detectable.
|
||||
|
||||
### 5. Drift detection as a build-time check, not a runtime feature
|
||||
|
||||
A `npm run check:catalog` script compares the card's `kegId` set against a copy of the integration catalogue committed under `docs/` or `scripts/` as reference data, and fails on: an ID in the integration catalogue with no card entry, a `kegId` not present in the integration catalogue, or a duplicate `kegId`.
|
||||
|
||||
This is the substitute for the tests the repo does not have, and it turns "the catalogues have drifted" into a failing command. Committing a snapshot of the upstream catalogue is deliberate: it keeps the check hermetic and makes each upstream sync an explicit, reviewable diff. Rejected alternative: fetching the catalogue from GitHub during the check. Non-hermetic and offline-hostile.
|
||||
|
||||
### 6. Stale-integration detection reuses the existing entity resolution
|
||||
|
||||
If the device resolves and a temperature sensor is found but neither keg sensor exists, the integration predates 0.4.0. That is distinguishable from "no keg tapped" (sensors exist, states are unknown/unavailable) and deserves its own message pointing at the integration update, because no amount of card configuration will fix it.
|
||||
|
||||
This also forces a fix to the `_resolveEntities` early return, `if (this._entityIds.temperature) return;`. That latch predates PR #1 but is now consequential: a user who updates the card before the integration latches on temperature alone and never discovers the keg sensors for the life of the card element. Resolution instead completes when the expected set is found, and re-runs while any are missing.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- **The 35 new catalogue entries need brewery, style, ABV and brand colours researched by hand, and errors there are invisible without the real keg.** → Table B of the mapping reference fixes the ID and name from upstream, so only the cosmetic metadata is judgement. Wrong brand colours degrade to slightly-off tinting, not a wrong beer name. Keep the palettes conservative where the brand is unfamiliar.
|
||||
|
||||
- **Table A's mappings are human judgement about which product corresponds to which catalogue entry, and a naive fuzzy match got 5 of 22 wrong.** → Those five are called out explicitly in the reference file. The residual risk is a beer rendering with a close sibling's artwork, which is visibly wrong to the owner of that keg and cheap to correct.
|
||||
|
||||
- **Reinstating `beer_name` risks re-normalising manual selection and undoing the point of PR #1.** → It is absent from `getStubConfig`, empty by default in the editor, and labelled as an override. A user who never touches it never sees it.
|
||||
|
||||
- **The committed upstream catalogue snapshot will itself go stale.** → It is reference data for a check, not runtime data, so a stale snapshot degrades to a weaker check rather than wrong behaviour. The check's own output names the missing IDs when it is re-synced.
|
||||
|
||||
- **Changing 12 existing labels is a visible change for users who currently see the integration's names.** → Table C lists every one so the diff is reviewable. All 12 move toward the more accurate curated name.
|
||||
|
||||
## Migration Plan
|
||||
|
||||
1. Land the catalogue and lookup changes first (tables A and B). Coverage rises to 100% with no behaviour change beyond more beers resolving.
|
||||
2. Land the detection precedence, label source and no-keg state. This is where the 12 labels from table C change and where the Leffe Blonde fallback disappears.
|
||||
3. Reinstate the `beer_name` override in types, editor and detection.
|
||||
4. Add the catalogue drift check and wire it alongside `npm run lint`.
|
||||
5. Update `README.md`, bump `package.json` and `EDITOR_VERSION`, rebuild `dist/`.
|
||||
|
||||
Rollback is per-step and low-risk: every step is additive to the merged state except step 2, which is the one behavioural change and is revertable on its own.
|
||||
|
||||
Users on integration < 0.4.0 see the new stale-integration message. That is a strict improvement over today, where they silently get Leffe Blonde.
|
||||
|
||||
## Open Questions
|
||||
|
||||
All three were resolved during implementation:
|
||||
|
||||
- **Glass matrix in the no-keg state** — shows an empty grid with a `--` count rather than hiding. This falls out of the existing `_renderKegContent` path when keg percentage is unknown, and reads as "machine is empty" rather than "card is broken". Still worth a second look on a real dashboard.
|
||||
- **`42863` "1L Stein"** — given its own catalogue entry under a `NON-BEER` section, presented as brewery "PerfectDraft", style "Merchandise", 0% ABV, on a neutral grey palette. The ID resolves, and it is not dressed up as a beer.
|
||||
- **Snapshot location** — `scripts/keg-catalog.reference.json`, next to the check that consumes it, with `_source` and `_upstreamCommit` keys recording provenance.
|
||||
|
||||
### Raised by implementation
|
||||
|
||||
- `kegId` is modelled as one ID per catalogue entry, which assumes a bijection between upstream product IDs and card entries. That held for all 114 IDs, but only after splitting Northern Monk into two entries. If PerfectDraft ever issues two IDs for a genuinely identical product, this model forces a duplicate entry rather than a list of aliases. Worth revisiting as `kegIds?: string[]` if that case appears; not worth the churn across 114 entries today.
|
||||
- Brand colours for the 36 new entries are researched judgement, not verified against physical kegs. Wrong values degrade to slightly-off tinting rather than a wrong beer name, and the least familiar brands (`romola`, `via-roma`) were given deliberately conservative palettes.
|
||||
@@ -0,0 +1,130 @@
|
||||
# Reference: integration product ID → card catalogue mapping
|
||||
|
||||
Source of truth: `custom_components/perfectdraft/keg_catalog.json` in
|
||||
[hassio-integration-perfectdraft-pro](https://github.com/Falkvinge/hassio-integration-perfectdraft-pro),
|
||||
114 entries as of integration commit `3c4b9ca6` ("Complete the keg name catalog: 86 -> 114 kegs").
|
||||
|
||||
Baseline: the card catalogue after PR #1 (`d0748e7`) maps 57 of those 114 IDs.
|
||||
The three tables below cover the remaining 57 IDs plus the 12 label divergences.
|
||||
Every mapping in table A was checked by hand; a naive fuzzy match got five of
|
||||
them wrong (see the notes under the table).
|
||||
|
||||
## Correction found during implementation
|
||||
|
||||
Product ID `48061` was **mis-mapped** by PR #1. It sat on the card's
|
||||
`northern-monk` entry, but upstream `48061` is "Northern Monk Faith" while that
|
||||
card entry is "Northern Monk A Little Faith" — genuinely different beers (Faith
|
||||
is a ~5.4% pale ale, A Little Faith a ~4% session pale). The correct ID for the
|
||||
existing entry is `47389`.
|
||||
|
||||
Resolved by pointing `northern-monk` at `47389` and giving `48061` its own
|
||||
`northern-monk-faith` entry sharing the same keg photograph. This is the only
|
||||
mis-mapping among the 57 IDs PR #1 already covered; the other 11 divergences in
|
||||
table C are naming style rather than wrong beers.
|
||||
|
||||
Net effect: 22 IDs mapped onto existing entries, 36 new catalogue entries
|
||||
(the 35 in table B plus `northern-monk-faith`), 114/114 covered.
|
||||
|
||||
## A. Add `kegId` to an existing card catalogue entry — 22 IDs
|
||||
|
||||
| Product ID | Integration name | Card slug | Card curated name | Ships keg art? |
|
||||
|---|---|---|---|---|
|
||||
| `797` | Leffe Rituel | `leffe-rituel` | Leffe Rituel 9° | yes |
|
||||
| `2565` | Hoegaarden Rose | `hoegaarden-rosee` | Hoegaarden Rosée | yes |
|
||||
| `3550` | Leffe Winter | `leffe-winter` | Leffe Winter | no |
|
||||
| `29775` | Goose Island Midway | `goose-midway` | Goose Midway Session IPA | yes |
|
||||
| `29896` | Kwak | `kwak` | Pauwel Kwak | yes |
|
||||
| `31718` | Leffe Summer | `leffe-dete` | Leffe d'Été | yes |
|
||||
| `32864` | Leffe Amber | `leffe-amber` | Leffe Ambrée | yes |
|
||||
| `33515` | La Virgen Madrid | `la-virgen` | La Virgen Lager | yes |
|
||||
| `33917` | Tiny Rebel Clwb Tropica | `tiny-rebel-clwb` | Tiny Rebel Clwb Tropicana | yes |
|
||||
| `41588` | Schneider's Bayrisch Hell | `schneider` | Schneider Bayrisch Hell | yes |
|
||||
| `42352` | St Feuillien Blonde | `saint-feuillien` | Saint-Feuillien Blonde | yes |
|
||||
| `42527` | Castelain Grand Cru | `castelain` | Castelain Grand Cru | yes |
|
||||
| `42703` | Brewdog Elvis Juice | `brewdog-elvis-juice` | BrewDog Elvis Juice | yes |
|
||||
| `42920` | Adnams Ghost Ship | `adnams` | Adnams Ghost Ship | no |
|
||||
| `44040` | Hertog Jan Grand Pilsener | `hertog-jan-grand` | Hertog Jan Grand Pilsener | yes |
|
||||
| `44387` | Mont Blanc La Rousse | `rousse-mont-blanc` | Rousse du Mont Blanc | yes |
|
||||
| `44425` | Camden IPA | `camden-ipa` | Camden IPA | yes |
|
||||
| `47362` | Leffe Prestige | `leffe-prestige` | Leffe Prestige 1240 | yes |
|
||||
| `47389` | Northern Monk A Little Faith | `northern-monk` | Northern Monk A Little Faith | yes |
|
||||
| `47494` | Proper Job | `st-austell` | St Austell Proper Job IPA | yes |
|
||||
| `47523` | Anosteké Blonde | `anoesteke` | Anosteké Blonde | yes |
|
||||
| `47774` | Old Speckled Hen | `old-speckled-hen` | Old Speckled Hen | yes |
|
||||
Notes on the non-obvious rows:
|
||||
|
||||
- `29775` "Goose Island Midway" is the card's `goose-midway` (Goose Midway Session IPA), **not** `goose-island-ipa`.
|
||||
- `31718` "Leffe Summer" is the card's `leffe-dete` (Leffe d'Été).
|
||||
- `44387` "Mont Blanc La Rousse" is the card's `rousse-mont-blanc` (Rousse du Mont Blanc).
|
||||
- `47494` "Proper Job" is the card's `st-austell` (St Austell Proper Job IPA).
|
||||
- `3550` and `42920` map to existing entries that carry no keg photo; they will use fallback art.
|
||||
|
||||
## B. Requires a new card catalogue entry — 35 IDs
|
||||
|
||||
None of these have a plausible existing entry. They need `slug`, `name`, `brewery`,
|
||||
`style`, `abv`, brand `colors` and a `kegId`. No keg photography is expected — the
|
||||
tiered-visual path will render brand-tinted fallback art.
|
||||
|
||||
`42863` "1L Stein" is merchandise rather than a beer, but the machine can report it,
|
||||
so it needs an entry to avoid an unresolved-ID state.
|
||||
|
||||
| Product ID | Integration name |
|
||||
|---|---|
|
||||
| `759` | Diekirch Grand Cru |
|
||||
| `760` | Diekirch Premium |
|
||||
| `1470` | Diekirch Christmas |
|
||||
| `2167` | Leffe Spring |
|
||||
| `2452` | Leffe Royal Whitbread Golding |
|
||||
| `9156` | Leffe Royal Cascade |
|
||||
| `29745` | Lowenbrau Oktoberfestbier |
|
||||
| `32814` | Romola |
|
||||
| `33642` | Ginette Bio Refreshing Blonde |
|
||||
| `33918` | Spaten Oktoberfestbier |
|
||||
| `34944` | Leffe La Légère |
|
||||
| `35168` | Goose Island Golden Goose |
|
||||
| `35344` | Ginette Bio White |
|
||||
| `36703` | Tiny Rebel Pineapple Express IPA |
|
||||
| `37005` | Tiny Rebel Cali Pale |
|
||||
| `37038` | Crew Republic Drunken Sailor |
|
||||
| `41832` | Mikkeller Heated Seats |
|
||||
| `42415` | Chernigivske |
|
||||
| `42528` | Palm |
|
||||
| `42641` | Kwak Rouge |
|
||||
| `42756` | Innis & Gunn Lager Beer |
|
||||
| `42778` | Mikkeller Game of Thrones |
|
||||
| `42863` | 1L Stein |
|
||||
| `42876` | Orchard Pig Reveller Cider |
|
||||
| `43033` | Hertog Jan Bockbier |
|
||||
| `43806` | Magic Rock Magic Orange |
|
||||
| `43807` | Brewdog Lost Lager |
|
||||
| `44238` | BrewDog Hopped in Harmony |
|
||||
| `44331` | Ninkasi Flower Lager |
|
||||
| `44474` | Camden Marzen |
|
||||
| `44536` | Tiny Rebel Stay Puft |
|
||||
| `44543` | Via Roma |
|
||||
| `47429` | Camden Lager Top |
|
||||
| `47816` | Corona Ligera |
|
||||
| `48134` | Kopparberg Crisp Apple |
|
||||
## C. Label divergence on IDs the card already maps — 12 IDs
|
||||
|
||||
The card recognises these product IDs but currently displays the integration's
|
||||
catalogue name. Once the label prefers the curated name, these revert to the
|
||||
left-hand column. Listed so the change in rendered output is reviewable.
|
||||
|
||||
Row `48061` is the exception noted above: it is a wrong-beer mapping rather than
|
||||
a naming difference, and was fixed by splitting the entry.
|
||||
|
||||
| Product ID | Card curated name (will be shown) | Integration name (shown today) |
|
||||
|---|---|---|
|
||||
| `456` | Diebels Alt | Diebels |
|
||||
| `500` | Hasseröder Premium | Hasseroder |
|
||||
| `43006` | Camden Hells | Camden Hells Lager |
|
||||
| `43235` | Corona Cero | Corona Cero (0.0% abv) |
|
||||
| `44059` | San Miguel | San Miguel Especial |
|
||||
| `44090` | Kopparberg Strawberry & Lime | Kopparberg Strawberry and Lime Cider |
|
||||
| `47144` | Haake-Beck | Haake Beck |
|
||||
| `47440` | Ninkasi IPA | Ninkasi French IPA |
|
||||
| `47629` | Camden Eazy | Camden Eazy IPA |
|
||||
| `47974` | Castelain Ch'ti Blonde | Ch'ti Blonde |
|
||||
| `47999` | Thatchers Gold | Thatchers Gold Cider |
|
||||
| `48061` | Northern Monk A Little Faith | Northern Monk Faith |
|
||||
@@ -0,0 +1,45 @@
|
||||
## Why
|
||||
|
||||
PR #1 (merged as `d0748e7`) made the card auto-detect the tapped beer from the integration's `keg_product_id` / `keg_name` sensors, and in the same commit deleted the manual beer picker along with the `beer_name` and `beer_entity` config options. The detection mechanism is correct, but its data coverage is not, and with the picker gone there is no longer any way for a user to correct a miss.
|
||||
|
||||
Concretely, against the integration's current 114-entry `keg_catalog.json`:
|
||||
|
||||
- The card maps only **57 of 114** product IDs. The other 57 fall through to name matching, and most of those fail too, landing on the grey "Custom Beer" placeholder.
|
||||
- **20 of those unmapped IDs correspond to beers whose keg photography already ships in this repo** — a Kwak keg renders as a grey box while `kegs/kwak.webp` sits unused, purely because the integration says "Kwak" and the card says "Pauwel Kwak".
|
||||
- When detection fails entirely, `resolveBeer(undefined)` returns `getAllBeers()[0]`, so the card confidently displays **Leffe Blonde** — a specific, wrong beer with full Leffe branding. Previously this path was unreachable because the editor forced a beer selection.
|
||||
- On 12 IDs the card *does* recognise, it still prefers the integration's catalogue name for the label, so curated names regress into product-listing strings: "Corona Cero" becomes "Corona Cero (0.0% abv)", "Thatchers Gold" becomes "Thatchers Gold Cider".
|
||||
|
||||
The integration is the upstream source of truth and has already moved on — commit `3c4b9ca6` grew its catalogue from 86 to 114 entries and cleaned up the names *after* PR #1 was authored. The card's copy was built against the older 86-entry table and is drifting. `README.md` still documents the removed picker and both removed config keys.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Complete the product-ID coverage to all 114 IDs in the integration catalogue: add `kegId` to 22 existing catalogue entries, and add 35 new entries for beers the card does not yet know.
|
||||
- Prefer the card's own curated beer name for the label whenever the product ID resolves, falling back to the integration-reported name only for unrecognised IDs.
|
||||
- Replace the Leffe Blonde fallback with an explicit, honest "no keg detected" state so the card never invents a beer.
|
||||
- **BREAKING (repair)** — reinstate `beer_name` as an optional manual override for unrecognised or mis-detected kegs, restoring the escape hatch PR #1 removed and re-enabling the `custom_beers` config that is currently unreachable.
|
||||
- Surface a clear message when the paired integration is too old to expose the keg sensors, instead of silently showing a wrong or empty beer.
|
||||
- Fix the `_resolveEntities` latch so keg sensors appearing after first resolve are still discovered.
|
||||
- Establish a repeatable way to check the card's mapping against the integration catalogue, so this drift is detectable rather than silent.
|
||||
- Update `README.md` to match the shipped behaviour and bump the card version.
|
||||
|
||||
## Capabilities
|
||||
|
||||
Note: `openspec/specs/` is currently empty — capability specs for this project live in the unarchived `perfectdraft-card` and `card-layouts-and-imagery` changes. The modified capabilities below refer to those established capability names.
|
||||
|
||||
### New Capabilities
|
||||
- `keg-auto-detection`: How the card resolves the tapped beer from the integration's keg sensors — product-ID-first matching, name fallback, manual override precedence, the no-keg and stale-integration states, and entity discovery lifecycle. This behaviour shipped in PR #1 with no spec covering it.
|
||||
|
||||
### Modified Capabilities
|
||||
- `beer-catalog`: Catalogue entries gain a `kegId` product-ID field, coverage becomes a stated requirement tied to the integration catalogue, and lookup by product ID is added alongside lookup by name and slug.
|
||||
- `beer-label`: The label's name source becomes explicitly defined (curated name preferred over integration-reported name), and the no-beer-detected label state is specified.
|
||||
- `card-config`: `beer_name` returns as an optional manual override rather than a required default; the removed `beer_entity` key stays removed; the unknown-`beer_name` scenario is restated in terms of override rather than primary selection.
|
||||
|
||||
## Impact
|
||||
|
||||
- `src/beer-catalog.ts` — `kegId` on 57 entries (22 existing, 35 new), product-ID index instead of the current linear scan.
|
||||
- `src/perfectdraft-card.ts` — detection precedence, label name source, no-keg render state, `_resolveEntities` latch.
|
||||
- `src/editor.ts` / `src/types.ts` — reinstate the optional `beer_name` override field.
|
||||
- `README.md` — remove the stale beer-selector and `beer_entity` documentation, document auto-detection and the override.
|
||||
- `package.json` / `dist/perfectdraft-card.js` — version bump and rebuilt bundle.
|
||||
- Upstream dependency: requires PerfectDraft integration **0.4.0+** (the release that added `keg_product_id` / `keg_name`). The 114-entry `custom_components/perfectdraft/keg_catalog.json` in that repo is the reference data for this change.
|
||||
- No new runtime dependencies. Artwork for the 35 new catalogue entries is out of scope; they get brand-tinted fallback art via the existing tiered-visual path.
|
||||
@@ -0,0 +1,66 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Product ID mapping to the integration catalog
|
||||
Each catalog entry SHALL be able to carry the PerfectDraft product ID of its keg, so the card can join against the product ID reported by the integration.
|
||||
|
||||
#### Scenario: Entry carries a product ID
|
||||
- **WHEN** a catalog entry corresponds to a keg listed in the integration's `keg_catalog.json`
|
||||
- **THEN** the entry SHALL carry a `kegId` field holding that product ID as a string
|
||||
|
||||
#### Scenario: Full coverage of the integration catalog
|
||||
- **WHEN** the card is loaded
|
||||
- **THEN** every product ID present in the integration's bundled keg catalog SHALL be carried by exactly one card catalog entry
|
||||
- **THEN** no `kegId` SHALL appear on more than one entry
|
||||
- **THEN** no `kegId` SHALL reference a product ID absent from the integration catalog
|
||||
|
||||
#### Scenario: Lookup by product ID
|
||||
- **WHEN** the card looks up a beer by product ID
|
||||
- **THEN** the lookup SHALL resolve without scanning the catalog linearly, using an index built once at module load alongside the existing slug and name indexes
|
||||
|
||||
### Requirement: Catalog coverage is verifiable
|
||||
The project SHALL provide a repeatable check that the card's product ID mapping agrees with the integration's keg catalog, so drift is detected rather than discovered by users.
|
||||
|
||||
#### Scenario: Check detects a missing mapping
|
||||
- **WHEN** the integration catalog contains a product ID that no card catalog entry carries
|
||||
- **THEN** the check SHALL fail and SHALL name the unmapped product ID and its integration-reported name
|
||||
|
||||
#### Scenario: Check detects a stale or duplicate mapping
|
||||
- **WHEN** a card catalog entry carries a `kegId` that is absent from the integration catalog, or two entries carry the same `kegId`
|
||||
- **THEN** the check SHALL fail and SHALL name the offending entries
|
||||
|
||||
#### Scenario: Check is offline
|
||||
- **WHEN** the check runs
|
||||
- **THEN** it SHALL compare against a committed snapshot of the integration catalog and SHALL NOT require network access
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Built-in PerfectDraft beer database
|
||||
The card SHALL include a built-in catalog of PerfectDraft beers with metadata for display purposes.
|
||||
|
||||
#### Scenario: Catalog data structure
|
||||
- **WHEN** the card is loaded
|
||||
- **THEN** each beer entry in the catalog SHALL contain: a unique slug (kebab-case), display name, brewery name, style, ABV (number), and a brand color palette (primary color, secondary color, text color)
|
||||
- **THEN** each entry MAY additionally carry a `kegId` product ID, a keg image path, and a brewery logo reference
|
||||
|
||||
#### Scenario: Catalog coverage
|
||||
- **WHEN** the card is loaded
|
||||
- **THEN** the catalog SHALL include an entry for every keg the paired integration can identify, and MAY include further entries for beers the integration does not list
|
||||
|
||||
### Requirement: Custom beer entries via configuration
|
||||
The card SHALL support user-defined beer entries that extend or override the built-in catalog, reachable through the `beer_name` override.
|
||||
|
||||
#### Scenario: Custom beer defined in config
|
||||
- **WHEN** the card config includes a `custom_beers` array with entries containing at minimum a `name` field
|
||||
- **THEN** those beers SHALL be resolvable by the `beer_name` override alongside built-in entries
|
||||
- **THEN** custom entries SHALL support optional fields: `color_primary`, `color_secondary`, `color_text`, `image_url`, `brewery`, `style`, `abv`
|
||||
|
||||
#### Scenario: Custom beer overrides built-in
|
||||
- **WHEN** a custom beer entry has the same slug as a built-in beer
|
||||
- **THEN** the custom entry SHALL override the built-in entry's fields
|
||||
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: Future automatic beer identification support
|
||||
**Reason**: This requirement described automatic identification as a future possibility driven by a user-supplied `beer_entity` pointing at an arbitrary sensor. Automatic identification is now the card's primary behaviour, driven by entities the card resolves itself from the configured device, and the `beer_entity` config key no longer exists. The replacement requirements live in the `keg-auto-detection` capability.
|
||||
|
||||
**Migration**: Users who set `beer_entity` should remove it; detection now happens without configuration. Users who relied on it to point at a non-standard entity should use the `beer_name` override instead. The `keg_id` lookup this requirement anticipated is now specified as the `kegId` product ID mapping above.
|
||||
@@ -0,0 +1,50 @@
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Beer name display
|
||||
The card SHALL display the detected beer's name in the label zone below the temperature, using the card's own curated name where it has one.
|
||||
|
||||
#### Scenario: Beer detected
|
||||
- **WHEN** a beer has been determined by detection or by the `beer_name` override
|
||||
- **THEN** the card SHALL display that beer's full name as text in the label zone
|
||||
|
||||
#### Scenario: Detected by product ID
|
||||
- **WHEN** the beer was matched by product ID
|
||||
- **THEN** the displayed name SHALL be the card catalog entry's curated name, not the name reported by the integration
|
||||
|
||||
#### Scenario: No beer detected
|
||||
- **WHEN** no beer could be determined
|
||||
- **THEN** the label zone SHALL indicate that no keg is detected
|
||||
- **THEN** the label zone SHALL NOT display the name of any catalog beer
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Label zone reflects detection state
|
||||
The label zone's styling SHALL follow the detection state so a user can tell a detected beer from an undetected one at a glance.
|
||||
|
||||
#### Scenario: Beer detected
|
||||
- **WHEN** a beer has been determined
|
||||
- **THEN** the label zone SHALL use that beer's brand color palette as its background gradient
|
||||
|
||||
#### Scenario: No beer detected
|
||||
- **WHEN** no beer could be determined
|
||||
- **THEN** the label zone SHALL use a neutral palette rather than any brand palette
|
||||
- **THEN** the card SHALL NOT render a keg photograph or brewery logo
|
||||
|
||||
### Requirement: Label zone is not a beer picker
|
||||
The label zone SHALL NOT act as a control for choosing a beer, since the beer is detected rather than chosen.
|
||||
|
||||
#### Scenario: Tapping the label zone
|
||||
- **WHEN** the user taps the label zone in any layout
|
||||
- **THEN** no beer selection dialog SHALL open
|
||||
|
||||
## REMOVED Requirements
|
||||
|
||||
### Requirement: Beer selection dialog
|
||||
**Reason**: The beer is now detected from the integration's keg sensors rather than chosen by the user, so a modal picker on the label zone is redundant and misleading — a selection made there would be overwritten on the next update. The dialog, its search field, and its custom-beer grouping were removed when auto-detection landed.
|
||||
|
||||
**Migration**: Users who need to correct or force the displayed beer should set the `beer_name` override in the card's visual editor, which takes precedence over detection. Users whose keg is not recognised should expect this to be fixed by extending the catalog's product ID coverage rather than by selecting manually.
|
||||
|
||||
### Requirement: Beer selection persistence
|
||||
**Reason**: There is no longer a user selection to persist. Persisting a beer choice in `localStorage` would also actively conflict with detection, since a stale stored value could contradict the keg actually in the machine. The `beer_entity` precedence scenario this requirement described no longer applies, as that config key was removed.
|
||||
|
||||
**Migration**: The `localStorage` beer key is no longer read or written and can be ignored; it is orphaned data on existing installations. Glass size persistence is unaffected and continues to work as before. A durable preference for a specific beer is expressed as the `beer_name` override in config, which persists as part of the dashboard configuration rather than per-browser.
|
||||
@@ -0,0 +1,89 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Optional manual beer override
|
||||
The card SHALL accept an optional `beer_name` config value that overrides auto-detection, so a user is never stuck with a wrong or unrecognised beer.
|
||||
|
||||
#### Scenario: Override absent
|
||||
- **WHEN** the card config has no `beer_name`
|
||||
- **THEN** the card SHALL rely entirely on auto-detection
|
||||
- **THEN** `getStubConfig()` SHALL NOT populate `beer_name`, so newly created cards start with detection only
|
||||
|
||||
#### Scenario: Override set
|
||||
- **WHEN** the card config sets `beer_name`
|
||||
- **THEN** the card SHALL display the beer resolved from that value regardless of what the keg sensors report
|
||||
|
||||
#### Scenario: Override presented as optional in the editor
|
||||
- **WHEN** the visual editor is displayed
|
||||
- **THEN** the beer override field SHALL be empty by default and SHALL be labelled as an override for when detection is wrong
|
||||
- **THEN** clearing the field SHALL remove `beer_name` from the config and return the card to detection
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Device-based entity resolution
|
||||
The card SHALL derive its sensor entity IDs from the configured device, not from manually entered entity IDs or prefixes.
|
||||
|
||||
#### Scenario: Entity resolution at runtime
|
||||
- **WHEN** the card has a `device_id` in its config
|
||||
- **THEN** the card SHALL resolve the temperature, keg_remaining, keg_freshness, keg_product_id, and keg_name sensor entities associated with that device
|
||||
- **THEN** the card SHALL use those resolved entities for all display values
|
||||
|
||||
#### Scenario: Device removed or unavailable
|
||||
- **WHEN** the configured `device_id` no longer exists in HA or has no associated entities
|
||||
- **THEN** the card SHALL display an error indicating the device is not found
|
||||
- **THEN** the error SHALL suggest re-configuring the card via the editor
|
||||
|
||||
#### Scenario: Keg sensors missing from an otherwise valid device
|
||||
- **WHEN** the device resolves and other sensors are found, but the keg_product_id and keg_name sensors are absent
|
||||
- **THEN** the card SHALL indicate that the PerfectDraft integration needs updating rather than reporting a device error
|
||||
|
||||
### Requirement: Configuration validation
|
||||
The card SHALL validate its configuration and display clear errors for invalid config.
|
||||
|
||||
#### Scenario: Missing device configuration
|
||||
- **WHEN** the card config has no `device_id`
|
||||
- **THEN** the card SHALL throw an error during `setConfig()` that triggers HA's built-in error card display
|
||||
- **THEN** the error message SHALL instruct the user to configure the card via the visual editor
|
||||
|
||||
#### Scenario: Invalid glass_size value
|
||||
- **WHEN** the card config specifies a `glass_size` that is not one of the supported values (250, 330, 500, 568, 473)
|
||||
- **THEN** the card SHALL fall back to the default of 330 mL
|
||||
|
||||
#### Scenario: Unknown beer_name override
|
||||
- **WHEN** the card config specifies a `beer_name` that does not match any beer in the catalog (built-in or custom)
|
||||
- **THEN** the card SHALL treat it as a custom beer with that name and use a generic color palette
|
||||
- **THEN** the card SHALL NOT fall back to auto-detection, since an explicit override signals the user's intent
|
||||
|
||||
#### Scenario: Removed configuration keys ignored
|
||||
- **WHEN** the card config contains `beer_entity`, which is no longer supported
|
||||
- **THEN** the card SHALL ignore it without throwing
|
||||
|
||||
### Requirement: Visual card editor
|
||||
The card SHALL provide a graphical configuration editor as the primary means of configuration.
|
||||
|
||||
#### Scenario: Editor registration
|
||||
- **WHEN** `getConfigElement()` is called on the card class
|
||||
- **THEN** it SHALL return a custom element that renders a configuration form
|
||||
- **THEN** `getStubConfig()` SHALL return a minimal valid configuration for new card creation (auto-selecting the sole device if only one exists)
|
||||
|
||||
#### Scenario: Editor fields
|
||||
- **WHEN** the visual editor is displayed
|
||||
- **THEN** it SHALL provide: a device picker (dropdown of discovered PerfectDraft devices), glass size (dropdown of five options), layout selection, and an optional beer override
|
||||
- **THEN** all fields SHALL be UI controls — no freeform text input for entity IDs
|
||||
- **THEN** the editor SHALL NOT present beer selection as a required or default setting
|
||||
|
||||
#### Scenario: Editor fires config-changed events
|
||||
- **WHEN** the user changes any editor field
|
||||
- **THEN** the editor SHALL fire a `config-changed` custom event with the updated config
|
||||
- **THEN** the card preview SHALL update to reflect the change
|
||||
|
||||
### Requirement: Custom beers configuration
|
||||
The card SHALL support extending the beer catalog via the `custom_beers` config array, reachable through the `beer_name` override.
|
||||
|
||||
#### Scenario: Custom beer entry structure
|
||||
- **WHEN** a `custom_beers` array entry is provided in config
|
||||
- **THEN** it SHALL require at minimum a `name` field (string)
|
||||
- **THEN** it SHALL accept optional fields: `color_primary` (CSS color), `color_secondary` (CSS color), `color_text` (CSS color), `image_url` (URL string), `brewery` (string), `style` (string), `abv` (number)
|
||||
|
||||
#### Scenario: Custom beer selected by override
|
||||
- **WHEN** `beer_name` matches the `name` of a `custom_beers` entry
|
||||
- **THEN** the card SHALL display that custom beer using its configured colors and image
|
||||
@@ -0,0 +1,89 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Tapped beer detected from integration sensors
|
||||
The card SHALL determine the tapped beer from the PerfectDraft integration's keg sensors without requiring the user to select it.
|
||||
|
||||
#### Scenario: Keg sensors resolved for the configured device
|
||||
- **WHEN** the card has a `device_id` and the device exposes sensors with translation keys `keg_product_id` and `keg_name`
|
||||
- **THEN** the card SHALL resolve both entity IDs and read their states on every `hass` update
|
||||
- **THEN** the card SHALL NOT require any beer-related configuration for detection to work
|
||||
|
||||
#### Scenario: Product ID matches a catalog entry
|
||||
- **WHEN** the `keg_product_id` sensor reports a state consisting only of digits that matches the `kegId` of a catalog entry
|
||||
- **THEN** the card SHALL use that catalog entry for the beer's name, brand colors, style, ABV, and keg artwork
|
||||
|
||||
#### Scenario: Product ID does not match but a name is reported
|
||||
- **WHEN** the `keg_product_id` state is absent, non-numeric, or matches no catalog entry, AND the `keg_name` sensor reports a state other than `unavailable` or `unknown`
|
||||
- **THEN** the card SHALL resolve the beer by that reported name against the catalog
|
||||
- **THEN** if the reported name matches no catalog entry, the card SHALL display that name against the generic color palette
|
||||
|
||||
### Requirement: Detection precedence
|
||||
The card SHALL apply a single, defined precedence order when determining which beer to display.
|
||||
|
||||
#### Scenario: Precedence order
|
||||
- **WHEN** the card determines the beer to display
|
||||
- **THEN** it SHALL apply the first applicable source in this order: (1) the `beer_name` config override, (2) a catalog entry matched by reported product ID, (3) a beer resolved from the reported keg name, (4) the no-keg-detected state
|
||||
- **THEN** no later source SHALL override an earlier one
|
||||
|
||||
#### Scenario: Override wins over successful detection
|
||||
- **WHEN** `beer_name` is set in config AND the product ID resolves to a different catalog entry
|
||||
- **THEN** the card SHALL display the beer named by `beer_name`
|
||||
- **THEN** the card SHALL NOT silently substitute the detected beer
|
||||
|
||||
### Requirement: Curated name preferred for the label
|
||||
When the card recognises the reported product ID, it SHALL use its own catalog name for display rather than the name reported by the integration.
|
||||
|
||||
#### Scenario: Product ID resolves and names differ
|
||||
- **WHEN** the product ID matches a catalog entry AND the `keg_name` sensor reports a different string for the same keg
|
||||
- **THEN** the card SHALL display the catalog entry's curated name
|
||||
- **THEN** the card SHALL NOT display the integration-reported name
|
||||
|
||||
#### Scenario: Product ID does not resolve
|
||||
- **WHEN** the product ID matches no catalog entry AND a usable `keg_name` state is reported
|
||||
- **THEN** the card SHALL display the integration-reported name, as it is the only name available
|
||||
|
||||
### Requirement: No-keg-detected state
|
||||
The card SHALL never display a specific beer that it has not detected, and SHALL make the absence of a detected beer visible.
|
||||
|
||||
#### Scenario: Sensors present but no keg reported
|
||||
- **WHEN** both keg sensors are resolved but neither yields a beer, for example because both report `unknown` or `unavailable`
|
||||
- **THEN** the card SHALL render a neutral palette with no keg photograph and no brewery logo
|
||||
- **THEN** the card SHALL display a label indicating that no keg is detected
|
||||
- **THEN** the card SHALL NOT display the name or branding of any catalog beer
|
||||
|
||||
#### Scenario: Detection never falls back to an arbitrary catalog entry
|
||||
- **WHEN** no beer can be determined from any source in the precedence order
|
||||
- **THEN** the card SHALL NOT select a beer by catalog position, insertion order, or any other arbitrary rule
|
||||
|
||||
#### Scenario: Other sensor values still shown
|
||||
- **WHEN** the card is in the no-keg-detected state AND the temperature or freshness sensors report usable values
|
||||
- **THEN** the card SHALL continue to display those values
|
||||
|
||||
### Requirement: Integration version guidance
|
||||
The card SHALL distinguish an out-of-date integration from an empty machine and guide the user accordingly.
|
||||
|
||||
#### Scenario: Device resolved but keg sensors absent
|
||||
- **WHEN** the configured device resolves and a temperature sensor is found, but no sensor with translation key `keg_product_id` or `keg_name` exists for that device
|
||||
- **THEN** the card SHALL display a message stating that the PerfectDraft integration must be updated to a version that provides the keg sensors
|
||||
- **THEN** that message SHALL be distinct from the no-keg-detected state
|
||||
|
||||
#### Scenario: Keg sensors present but idle
|
||||
- **WHEN** the keg sensors exist for the device but report no usable value
|
||||
- **THEN** the card SHALL show the no-keg-detected state and SHALL NOT suggest updating the integration
|
||||
|
||||
### Requirement: Entity resolution completes as entities appear
|
||||
The card SHALL continue attempting entity resolution until the expected sensors are found, so that sensors registered after the card first renders are still discovered.
|
||||
|
||||
#### Scenario: Keg sensors appear after initial resolution
|
||||
- **WHEN** the card has already resolved a temperature entity for its device AND the keg sensors are subsequently added to that device, for example because the user updated the integration
|
||||
- **THEN** the card SHALL resolve the keg entities on a following `hass` update without requiring a browser reload
|
||||
|
||||
#### Scenario: Resolution stops once complete
|
||||
- **WHEN** all expected sensor entities for the device have been resolved
|
||||
- **THEN** the card SHALL NOT repeat the registry scan on subsequent `hass` updates
|
||||
|
||||
#### Scenario: Configured device changes
|
||||
- **WHEN** the card's configured `device_id` changes, for example because the user picked a different device in the editor
|
||||
- **THEN** the card SHALL discard the previously resolved entity IDs and the previously detected beer
|
||||
- **THEN** the card SHALL resolve entities afresh for the newly configured device
|
||||
- **THEN** the card SHALL NOT display values read from the previous device
|
||||
@@ -0,0 +1,58 @@
|
||||
## 1. Catalog coverage
|
||||
|
||||
- [x] 1.1 Commit a snapshot of the integration's 114-entry `keg_catalog.json` as reference data for the drift check, and note the upstream commit it came from
|
||||
- [x] 1.2 Add `kegId` to the 22 existing catalog entries listed in table A of `keg-id-mapping.md`, taking care with the five hand-corrected rows called out beneath that table
|
||||
- [x] 1.3 Add the 35 new catalog entries from table B, each with slug, curated name, brewery, style, ABV, brand colors and `kegId`; no `imagePath`, so they fall through to brand-tinted fallback art
|
||||
- [x] 1.4 Give `42863` "1L Stein" an entry so the ID resolves, and decide whether it presents as merchandise rather than as a beer
|
||||
- [x] 1.5 Replace the linear scan in `getBeerByKegId` with a `kegIdIndex` map built at module load alongside `slugIndex` and `nameIndex`
|
||||
- [x] 1.6 Fix product ID `48061`, which PR #1 mapped to the wrong beer: point `northern-monk` at `47389` and give `48061` its own `northern-monk-faith` entry
|
||||
|
||||
## 2. Catalog drift check
|
||||
|
||||
- [x] 2.1 Add a `scripts/check-catalog.mjs` that loads the catalog snapshot and the card catalog and reports unmapped integration IDs, card `kegId` values absent upstream, and duplicate `kegId` values
|
||||
- [x] 2.2 Wire it as `npm run check:catalog` with a non-zero exit on any finding, and confirm it passes against the completed catalog from section 1
|
||||
- [x] 2.3 Verify the check actually fails when a `kegId` is temporarily removed, so it is not silently passing
|
||||
|
||||
## 3. Detection precedence and label source
|
||||
|
||||
- [x] 3.1 Change `resolveBeer(undefined)` to return the neutral `custom` fallback instead of `getAllBeers()[0]`, removing the Leffe Blonde trap at its source
|
||||
- [x] 3.2 Rework the detection block in `render()` to apply the precedence order from the `keg-auto-detection` spec: override, then product ID, then reported name, then no-keg
|
||||
- [x] 3.3 Use the curated catalog name for the label when the product ID resolves, keeping the integration-reported name only for unresolved IDs; this changes the 12 labels in table C
|
||||
- [x] 3.4 Move the detection assignment out of `render()` so `_beer` is not mutated during rendering, and confirm no Lit change-in-update warning appears in the console
|
||||
|
||||
## 4. No-keg and stale-integration states
|
||||
|
||||
- [x] 4.1 Add an explicit no-keg-detected render state with a neutral palette, no keg photo and no brewery logo, and make sure temperature and freshness still display
|
||||
- [x] 4.2 Resolve the open question on whether the glass matrix hides or shows zero in the no-keg state, against a real dashboard
|
||||
- [x] 4.3 Detect the case where the device resolves and a temperature sensor exists but neither keg sensor does, and show a message telling the user to update the integration
|
||||
- [x] 4.4 Confirm the stale-integration message is visually and textually distinct from the no-keg-detected state
|
||||
|
||||
## 5. Manual override
|
||||
|
||||
- [x] 5.1 Reinstate `beer_name` as an optional field in `PerfectDraftCardConfig`, leaving `beer_entity` removed
|
||||
- [x] 5.2 Wire the override into detection as the highest-precedence source, including resolution against `custom_beers`
|
||||
- [x] 5.3 Add an optional, empty-by-default override field to the editor, labelled as a correction for when detection is wrong, and confirm clearing it removes the key from config
|
||||
- [x] 5.4 Confirm `getStubConfig()` does not populate `beer_name`, so new cards start on detection only
|
||||
|
||||
## 6. Entity resolution lifecycle
|
||||
|
||||
- [x] 6.1 Replace the `if (this._entityIds.temperature) return;` latch in `_resolveEntities` with a condition that only stops once the expected sensor set is resolved
|
||||
- [x] 6.2 Verify that keg sensors added after first render are picked up on a later `hass` update without a browser reload, and that the scan stops once complete
|
||||
- [x] 6.3 Invalidate the resolved entity IDs and detected beer in `setConfig` when `device_id` changes, so switching devices in the editor does not keep reading the previous device's sensors (pre-existing bug, surfaced by review)
|
||||
|
||||
## 7. Documentation and release
|
||||
|
||||
- [x] 7.1 Rewrite the README's beer sections: drop the beer-selector feature bullet, the "select your default beer" setup step and the `beer_entity` YAML line; document auto-detection and the `beer_name` override
|
||||
- [x] 7.2 State the PerfectDraft integration 0.4.0+ requirement in the README's Requirements section
|
||||
- [x] 7.3 Bump `package.json` and `EDITOR_VERSION`, and refresh the lockfile with the project's normal npm version to avoid unrelated churn
|
||||
- [x] 7.4 Run `npm run lint`, `npm run check:catalog` and `npm run build`, and commit the rebuilt `dist/perfectdraft-card.js`
|
||||
- [x] 7.5 Confirm the committed bundle is reproducible from source with a clean `npm ci && npm run build`
|
||||
|
||||
## 8. Verification against real hardware
|
||||
|
||||
Requires a PerfectDraft Pro on integration 0.4.0+; cannot be verified from the
|
||||
repository alone.
|
||||
|
||||
- [ ] 8.1 Confirm a recognised keg shows the curated name and correct artwork, checking at least one of the 20 table A entries whose photo was previously unreachable
|
||||
- [ ] 8.2 Confirm an empty machine shows the no-keg state and never names a beer
|
||||
- [ ] 8.3 Confirm the override wins over a detected keg, and that removing it returns the card to detection
|
||||
Generated
+3
-42
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "perfectdraft-card",
|
||||
"version": "0.1.0",
|
||||
"version": "0.3.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "perfectdraft-card",
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"version": "0.3.1",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"custom-card-helpers": "^1.9.0",
|
||||
"lit": "^3.2.0"
|
||||
@@ -374,9 +374,6 @@
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -391,9 +388,6 @@
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -408,9 +402,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -425,9 +416,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -442,9 +430,6 @@
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -459,9 +444,6 @@
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -476,9 +458,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -493,9 +472,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -510,9 +486,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -527,9 +500,6 @@
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -544,9 +514,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -561,9 +528,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -578,9 +542,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
||||
+3
-2
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "perfectdraft-card",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Custom Lovelace card for the PerfectDraft Pro Home Assistant integration",
|
||||
"main": "dist/perfectdraft-card.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"watch": "rollup -c --watch",
|
||||
"lint": "tsc --noEmit"
|
||||
"lint": "tsc --noEmit",
|
||||
"check:catalog": "node scripts/check-catalog.mjs"
|
||||
},
|
||||
"keywords": [
|
||||
"home-assistant",
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env node
|
||||
// Compares the card catalog's kegId coverage against a committed snapshot of the
|
||||
// PerfectDraft integration's keg_catalog.json. The card joins against the
|
||||
// integration on product ID, so a gap here is a keg that renders without its
|
||||
// branding. Run via `npm run check:catalog`.
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url));
|
||||
const reference = JSON.parse(readFileSync(join(here, "keg-catalog.reference.json"), "utf8"));
|
||||
const source = readFileSync(join(here, "..", "src", "beer-catalog.ts"), "utf8");
|
||||
|
||||
const upstream = reference.kegs;
|
||||
|
||||
// The catalog is one entry per line, which keeps this parse honest without
|
||||
// pulling in a TypeScript parser just for a data check.
|
||||
const entries = [];
|
||||
for (const line of source.split("\n")) {
|
||||
const slug = line.match(/slug: "(.*?)"/);
|
||||
if (!slug) continue;
|
||||
const name = line.match(/name: "(.*?)"/);
|
||||
const kegId = line.match(/kegId: "(\d+)"/);
|
||||
entries.push({ slug: slug[1], name: name?.[1] ?? "", kegId: kegId?.[1] });
|
||||
}
|
||||
|
||||
const problems = [];
|
||||
|
||||
const seen = new Map();
|
||||
for (const entry of entries) {
|
||||
if (!entry.kegId) continue;
|
||||
if (seen.has(entry.kegId)) {
|
||||
problems.push(
|
||||
`duplicate kegId ${entry.kegId}: "${seen.get(entry.kegId).slug}" and "${entry.slug}"`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
seen.set(entry.kegId, entry);
|
||||
}
|
||||
|
||||
for (const [kegId, entry] of seen) {
|
||||
if (!(kegId in upstream)) {
|
||||
problems.push(`kegId ${kegId} on "${entry.slug}" is absent from the integration catalog`);
|
||||
}
|
||||
}
|
||||
|
||||
for (const [kegId, name] of Object.entries(upstream)) {
|
||||
if (!seen.has(kegId)) {
|
||||
problems.push(`product ID ${kegId} ("${name}") has no card catalog entry`);
|
||||
}
|
||||
}
|
||||
|
||||
const covered = Object.keys(upstream).filter((id) => seen.has(id)).length;
|
||||
const total = Object.keys(upstream).length;
|
||||
console.log(
|
||||
`catalog: ${entries.length} entries, ${seen.size} mapped product IDs, ` +
|
||||
`${covered}/${total} of the integration catalog covered ` +
|
||||
`(upstream snapshot @ ${reference._upstreamCommit})`,
|
||||
);
|
||||
|
||||
if (problems.length > 0) {
|
||||
console.error(`\n${problems.length} problem(s):`);
|
||||
for (const problem of problems.sort()) console.error(` - ${problem}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("catalog coverage is complete and consistent");
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"_source": "https://github.com/Falkvinge/hassio-integration-perfectdraft-pro/blob/main/custom_components/perfectdraft/keg_catalog.json",
|
||||
"_upstreamCommit": "3c4b9ca6",
|
||||
"_note": "Reference snapshot for npm run check:catalog. Not used at runtime. Re-sync when the integration catalog changes.",
|
||||
"kegs": {
|
||||
"452": "Beck's Gold",
|
||||
"453": "Beck's",
|
||||
"454": "Löwenbräu",
|
||||
"455": "Franziskaner Weissbier",
|
||||
"456": "Diebels",
|
||||
"457": "Stella Artois",
|
||||
"458": "Jupiler",
|
||||
"500": "Hasseroder",
|
||||
"509": "Leffe Blonde",
|
||||
"679": "Hoegaarden",
|
||||
"759": "Diekirch Grand Cru",
|
||||
"760": "Diekirch Premium",
|
||||
"797": "Leffe Rituel",
|
||||
"1095": "Leffe Ruby",
|
||||
"1470": "Diekirch Christmas",
|
||||
"2073": "Hertog Jan",
|
||||
"2167": "Leffe Spring",
|
||||
"2172": "Leffe Brune",
|
||||
"2452": "Leffe Royal Whitbread Golding",
|
||||
"2565": "Hoegaarden Rose",
|
||||
"3550": "Leffe Winter",
|
||||
"9156": "Leffe Royal Cascade",
|
||||
"29745": "Lowenbrau Oktoberfestbier",
|
||||
"29775": "Goose Island Midway",
|
||||
"29896": "Kwak",
|
||||
"29974": "Spaten",
|
||||
"30955": "Franziskaner Royal",
|
||||
"31718": "Leffe Summer",
|
||||
"31747": "Budweiser",
|
||||
"31896": "Tripel Karmeliet",
|
||||
"32814": "Romola",
|
||||
"32816": "Goose Island IPA",
|
||||
"32864": "Leffe Amber",
|
||||
"33515": "La Virgen Madrid",
|
||||
"33642": "Ginette Bio Refreshing Blonde",
|
||||
"33917": "Tiny Rebel Clwb Tropica",
|
||||
"33918": "Spaten Oktoberfestbier",
|
||||
"34327": "Thornbridge Jaipur",
|
||||
"34493": "Corona Extra",
|
||||
"34944": "Leffe La Légère",
|
||||
"35168": "Goose Island Golden Goose",
|
||||
"35344": "Ginette Bio White",
|
||||
"36302": "Tennent's Lager",
|
||||
"36703": "Tiny Rebel Pineapple Express IPA",
|
||||
"37005": "Tiny Rebel Cali Pale",
|
||||
"37038": "Crew Republic Drunken Sailor",
|
||||
"41588": "Schneider's Bayrisch Hell",
|
||||
"41830": "BrewDog Punk IPA",
|
||||
"41832": "Mikkeller Heated Seats",
|
||||
"42223": "Victoria",
|
||||
"42352": "St Feuillien Blonde",
|
||||
"42377": "Bud Light",
|
||||
"42415": "Chernigivske",
|
||||
"42526": "Vocation Life & Death",
|
||||
"42527": "Castelain Grand Cru",
|
||||
"42528": "Palm",
|
||||
"42640": "Kwak Blonde",
|
||||
"42641": "Kwak Rouge",
|
||||
"42703": "Brewdog Elvis Juice",
|
||||
"42756": "Innis & Gunn Lager Beer",
|
||||
"42778": "Mikkeller Game of Thrones",
|
||||
"42863": "1L Stein",
|
||||
"42876": "Orchard Pig Reveller Cider",
|
||||
"42920": "Adnams Ghost Ship",
|
||||
"43006": "Camden Hells Lager",
|
||||
"43009": "Stella Artois Unfiltered",
|
||||
"43019": "Hawkstone Lager",
|
||||
"43033": "Hertog Jan Bockbier",
|
||||
"43235": "Corona Cero (0.0% abv)",
|
||||
"43805": "Camden Pale Ale",
|
||||
"43806": "Magic Rock Magic Orange",
|
||||
"43807": "Brewdog Lost Lager",
|
||||
"44040": "Hertog Jan Grand Pilsener",
|
||||
"44059": "San Miguel Especial",
|
||||
"44090": "Kopparberg Strawberry and Lime Cider",
|
||||
"44171": "Leffe Blanche",
|
||||
"44238": "BrewDog Hopped in Harmony",
|
||||
"44331": "Ninkasi Flower Lager",
|
||||
"44387": "Mont Blanc La Rousse",
|
||||
"44425": "Camden IPA",
|
||||
"44452": "Franziskaner Kellerbier",
|
||||
"44474": "Camden Marzen",
|
||||
"44526": "Mahou",
|
||||
"44536": "Tiny Rebel Stay Puft",
|
||||
"44543": "Via Roma",
|
||||
"47144": "Haake Beck",
|
||||
"47285": "Theakston Old Peculier",
|
||||
"47362": "Leffe Prestige",
|
||||
"47384": "Peroni Nastro Azzurro",
|
||||
"47389": "Northern Monk A Little Faith",
|
||||
"47418": "Singha",
|
||||
"47429": "Camden Lager Top",
|
||||
"47440": "Ninkasi French IPA",
|
||||
"47486": "Meteor White IPA",
|
||||
"47494": "Proper Job",
|
||||
"47523": "Anosteké Blonde",
|
||||
"47629": "Camden Eazy IPA",
|
||||
"47774": "Old Speckled Hen",
|
||||
"47816": "Corona Ligera",
|
||||
"47943": "Fuller's London Pride",
|
||||
"47962": "Bass Pale Ale",
|
||||
"47972": "Stella Artois 0.0%",
|
||||
"47973": "Trooper Original",
|
||||
"47974": "Ch'ti Blonde",
|
||||
"47977": "Früh Kölsch",
|
||||
"47978": "Saison Dupont Dry Hop",
|
||||
"47979": "Modelo Especial",
|
||||
"47984": "Samson 11",
|
||||
"47986": "La Chouffe Blonde",
|
||||
"47999": "Thatchers Gold Cider",
|
||||
"48019": "Leffe Blonde 0.0%",
|
||||
"48024": "Siren Lumina IPA",
|
||||
"48061": "Northern Monk Faith",
|
||||
"48134": "Kopparberg Crisp Apple"
|
||||
}
|
||||
}
|
||||
+136
-71
@@ -28,105 +28,162 @@ export function getBreweryLogo(brewery: string | undefined): string | undefined
|
||||
|
||||
const CATALOG: BeerEntry[] = [
|
||||
// === LEFFE ===
|
||||
{ slug: "leffe-blonde", name: "Leffe Blonde", brewery: "Abbaye de Leffe", style: "Belgian Blonde", abv: 6.6, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("leffe-blonde") },
|
||||
{ slug: "leffe-brune", name: "Leffe Brune", brewery: "Abbaye de Leffe", style: "Belgian Dubbel", abv: 6.5, colors: { primary: "#4A2810", secondary: "#F5E6D0", text: "#FFFFFF" }, imagePath: kegImage("leffe-brune") },
|
||||
{ slug: "leffe-amber", name: "Leffe Ambrée", brewery: "Abbaye de Leffe", style: "Belgian Amber", abv: 6.6, colors: { primary: "#B5651D", secondary: "#FFF0D6", text: "#1A0F00" }, imagePath: kegImage("leffe-amber") },
|
||||
{ slug: "leffe-ruby", name: "Leffe Ruby", brewery: "Abbaye de Leffe", style: "Belgian Fruit Beer", abv: 5.0, colors: { primary: "#8B1A4A", secondary: "#FFE6F0", text: "#FFFFFF" }, imagePath: kegImage("leffe-ruby") },
|
||||
{ slug: "leffe-blanche", name: "Leffe Blanche", brewery: "Abbaye de Leffe", style: "Belgian Witbier", abv: 5.0, colors: { primary: "#E8DCC8", secondary: "#FFFDF5", text: "#2C2C2C" }, imagePath: kegImage("leffe-blanche") },
|
||||
{ slug: "leffe-winter", name: "Leffe Winter", brewery: "Abbaye de Leffe", style: "Belgian Winter Ale", abv: 6.6, colors: { primary: "#1B3A5C", secondary: "#E0ECF8", text: "#FFFFFF" } },
|
||||
{ slug: "leffe-blonde", name: "Leffe Blonde", brewery: "Abbaye de Leffe", style: "Belgian Blonde", abv: 6.6, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("leffe-blonde"), kegId: "509" },
|
||||
{ slug: "leffe-brune", name: "Leffe Brune", brewery: "Abbaye de Leffe", style: "Belgian Dubbel", abv: 6.5, colors: { primary: "#4A2810", secondary: "#F5E6D0", text: "#FFFFFF" }, imagePath: kegImage("leffe-brune"), kegId: "2172" },
|
||||
{ slug: "leffe-amber", name: "Leffe Ambrée", brewery: "Abbaye de Leffe", style: "Belgian Amber", abv: 6.6, colors: { primary: "#B5651D", secondary: "#FFF0D6", text: "#1A0F00" }, imagePath: kegImage("leffe-amber"), kegId: "32864" },
|
||||
{ slug: "leffe-ruby", name: "Leffe Ruby", brewery: "Abbaye de Leffe", style: "Belgian Fruit Beer", abv: 5.0, colors: { primary: "#8B1A4A", secondary: "#FFE6F0", text: "#FFFFFF" }, imagePath: kegImage("leffe-ruby"), kegId: "1095" },
|
||||
{ slug: "leffe-blanche", name: "Leffe Blanche", brewery: "Abbaye de Leffe", style: "Belgian Witbier", abv: 5.0, colors: { primary: "#E8DCC8", secondary: "#FFFDF5", text: "#2C2C2C" }, imagePath: kegImage("leffe-blanche"), kegId: "44171" },
|
||||
{ slug: "leffe-winter", name: "Leffe Winter", brewery: "Abbaye de Leffe", style: "Belgian Winter Ale", abv: 6.6, colors: { primary: "#1B3A5C", secondary: "#E0ECF8", text: "#FFFFFF" }, kegId: "3550" },
|
||||
{ slug: "leffe-noel", name: "Leffe Noël", brewery: "Abbaye de Leffe", style: "Belgian Winter Ale", abv: 6.6, colors: { primary: "#1B3A5C", secondary: "#E0ECF8", text: "#FFFFFF" } },
|
||||
{ slug: "leffe-dete", name: "Leffe d'Été", brewery: "Abbaye de Leffe", style: "Belgian Summer Ale", abv: 5.2, colors: { primary: "#F5C242", secondary: "#FFFBE6", text: "#1A0F00" }, imagePath: kegImage("leffe-dete") },
|
||||
{ slug: "leffe-rituel", name: "Leffe Rituel 9°", brewery: "Abbaye de Leffe", style: "Belgian Strong Ale", abv: 9.0, colors: { primary: "#2C1A00", secondary: "#F5E6D0", text: "#C8922A" }, imagePath: kegImage("leffe-rituel") },
|
||||
{ slug: "leffe-prestige", name: "Leffe Prestige 1240", brewery: "Abbaye de Leffe", style: "Belgian Strong Blonde", abv: 8.5, colors: { primary: "#1A3366", secondary: "#E0E8F5", text: "#C8922A" }, imagePath: kegImage("leffe-prestige") },
|
||||
{ slug: "leffe-0", name: "Leffe Blonde 0.0%", brewery: "Abbaye de Leffe", style: "Non-Alcoholic Blonde", abv: 0.0, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("leffe-0") },
|
||||
{ slug: "leffe-dete", name: "Leffe d'Été", brewery: "Abbaye de Leffe", style: "Belgian Summer Ale", abv: 5.2, colors: { primary: "#F5C242", secondary: "#FFFBE6", text: "#1A0F00" }, imagePath: kegImage("leffe-dete"), kegId: "31718" },
|
||||
{ slug: "leffe-rituel", name: "Leffe Rituel 9°", brewery: "Abbaye de Leffe", style: "Belgian Strong Ale", abv: 9.0, colors: { primary: "#2C1A00", secondary: "#F5E6D0", text: "#C8922A" }, imagePath: kegImage("leffe-rituel"), kegId: "797" },
|
||||
{ slug: "leffe-prestige", name: "Leffe Prestige 1240", brewery: "Abbaye de Leffe", style: "Belgian Strong Blonde", abv: 8.5, colors: { primary: "#1A3366", secondary: "#E0E8F5", text: "#C8922A" }, imagePath: kegImage("leffe-prestige"), kegId: "47362" },
|
||||
{ slug: "leffe-0", name: "Leffe Blonde 0.0%", brewery: "Abbaye de Leffe", style: "Non-Alcoholic Blonde", abv: 0.0, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("leffe-0"), kegId: "48019" },
|
||||
{ slug: "leffe-spring", name: "Leffe Spring", brewery: "Abbaye de Leffe", style: "Belgian Blonde", abv: 5.5, colors: { primary: "#9CB43C", secondary: "#F5FBE8", text: "#1A0F00" }, kegId: "2167" },
|
||||
{ slug: "leffe-la-legere", name: "Leffe La Légère", brewery: "Abbaye de Leffe", style: "Belgian Light Blonde", abv: 4.0, colors: { primary: "#E0C56A", secondary: "#FFFBEC", text: "#1A0F00" }, kegId: "34944" },
|
||||
{ slug: "leffe-royal-whitbread", name: "Leffe Royale Whitbread Golding", brewery: "Abbaye de Leffe", style: "Belgian Strong Blonde", abv: 7.5, colors: { primary: "#8B6914", secondary: "#FFF8E0", text: "#F5E6C8" }, kegId: "2452" },
|
||||
{ slug: "leffe-royal-cascade", name: "Leffe Royale Cascade IPA", brewery: "Abbaye de Leffe", style: "Belgian IPA", abv: 7.5, colors: { primary: "#4A6B2A", secondary: "#F0F8E0", text: "#F5E6C8" }, kegId: "9156" },
|
||||
|
||||
// === BELGIAN CLASSICS ===
|
||||
{ slug: "hoegaarden", name: "Hoegaarden", brewery: "Brouwerij van Hoegaarden", style: "Belgian Witbier", abv: 4.9, colors: { primary: "#F0E4C8", secondary: "#FFFDF2", text: "#2A4B1E" }, imagePath: kegImage("hoegaarden") },
|
||||
{ slug: "hoegaarden-rosee", name: "Hoegaarden Rosée", brewery: "Brouwerij van Hoegaarden", style: "Fruit Witbier", abv: 3.0, colors: { primary: "#E87D9F", secondary: "#FFF0F5", text: "#4A0028" }, imagePath: kegImage("hoegaarden-rosee") },
|
||||
{ slug: "jupiler", name: "Jupiler", brewery: "AB InBev Belgium", style: "Belgian Pilsner", abv: 5.2, colors: { primary: "#D4001A", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("jupiler") },
|
||||
{ slug: "kwak", name: "Pauwel Kwak", brewery: "Brouwerij Bosteels", style: "Belgian Strong Ale", abv: 8.4, colors: { primary: "#B34700", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("kwak") },
|
||||
{ slug: "kwak-blonde", name: "Kwak Blonde", brewery: "Brouwerij Bosteels", style: "Belgian Blonde", abv: 7.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#2C1A00" }, imagePath: kegImage("kwak-blonde") },
|
||||
{ slug: "tripel-karmeliet", name: "Tripel Karmeliet", brewery: "Brouwerij Bosteels", style: "Belgian Tripel", abv: 8.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#2C1A00" }, imagePath: kegImage("tripel-karmeliet") },
|
||||
{ slug: "hoegaarden", name: "Hoegaarden", brewery: "Brouwerij van Hoegaarden", style: "Belgian Witbier", abv: 4.9, colors: { primary: "#F0E4C8", secondary: "#FFFDF2", text: "#2A4B1E" }, imagePath: kegImage("hoegaarden"), kegId: "679" },
|
||||
{ slug: "hoegaarden-rosee", name: "Hoegaarden Rosée", brewery: "Brouwerij van Hoegaarden", style: "Fruit Witbier", abv: 3.0, colors: { primary: "#E87D9F", secondary: "#FFF0F5", text: "#4A0028" }, imagePath: kegImage("hoegaarden-rosee"), kegId: "2565" },
|
||||
{ slug: "jupiler", name: "Jupiler", brewery: "AB InBev Belgium", style: "Belgian Pilsner", abv: 5.2, colors: { primary: "#D4001A", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("jupiler"), kegId: "458" },
|
||||
{ slug: "kwak", name: "Pauwel Kwak", brewery: "Brouwerij Bosteels", style: "Belgian Strong Ale", abv: 8.4, colors: { primary: "#B34700", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("kwak"), kegId: "29896" },
|
||||
{ slug: "kwak-blonde", name: "Kwak Blonde", brewery: "Brouwerij Bosteels", style: "Belgian Blonde", abv: 7.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#2C1A00" }, imagePath: kegImage("kwak-blonde"), kegId: "42640" },
|
||||
{ slug: "tripel-karmeliet", name: "Tripel Karmeliet", brewery: "Brouwerij Bosteels", style: "Belgian Tripel", abv: 8.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#2C1A00" }, imagePath: kegImage("tripel-karmeliet"), kegId: "31896" },
|
||||
{ slug: "gulden-draak", name: "Gulden Draak", brewery: "Brouwerij Van Steenberge", style: "Belgian Strong Dark", abv: 10.5, colors: { primary: "#1A1A2E", secondary: "#E8E0F0", text: "#C9A24D" } },
|
||||
{ slug: "saint-feuillien", name: "Saint-Feuillien Blonde", brewery: "Brasserie St-Feuillien", style: "Belgian Blonde", abv: 7.5, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("saint-feuillien") },
|
||||
{ slug: "dupont", name: "Saison Dupont Dry Hop", brewery: "Brasserie Dupont", style: "Belgian Saison", abv: 6.5, colors: { primary: "#8B6914", secondary: "#FFF8E0", text: "#1A0F00" }, imagePath: kegImage("dupont") },
|
||||
{ slug: "saint-feuillien", name: "Saint-Feuillien Blonde", brewery: "Brasserie St-Feuillien", style: "Belgian Blonde", abv: 7.5, colors: { primary: "#C8922A", secondary: "#FFF6E0", text: "#1A0F00" }, imagePath: kegImage("saint-feuillien"), kegId: "42352" },
|
||||
{ slug: "dupont", name: "Saison Dupont Dry Hop", brewery: "Brasserie Dupont", style: "Belgian Saison", abv: 6.5, colors: { primary: "#8B6914", secondary: "#FFF8E0", text: "#1A0F00" }, imagePath: kegImage("dupont"), kegId: "47978" },
|
||||
|
||||
// === STELLA ARTOIS ===
|
||||
{ slug: "stella-artois", name: "Stella Artois", brewery: "Brouwerij Artois", style: "Belgian Lager", abv: 5.2, colors: { primary: "#0E4C1E", secondary: "#F0F8E8", text: "#FFFFFF" }, imagePath: kegImage("stella-artois") },
|
||||
{ slug: "stella-artois-unfiltered", name: "Stella Artois Unfiltered", brewery: "Brouwerij Artois", style: "Unfiltered Lager", abv: 5.0, colors: { primary: "#D4A547", secondary: "#FFFCE8", text: "#0E4C1E" }, imagePath: kegImage("stella-artois-unfiltered") },
|
||||
{ slug: "stella-artois-0", name: "Stella Artois 0.0%", brewery: "Brouwerij Artois", style: "Non-Alcoholic Lager", abv: 0.0, colors: { primary: "#0E4C1E", secondary: "#F0F8E8", text: "#FFFFFF" }, imagePath: kegImage("stella-artois-0") },
|
||||
{ slug: "stella-artois", name: "Stella Artois", brewery: "Brouwerij Artois", style: "Belgian Lager", abv: 5.2, colors: { primary: "#0E4C1E", secondary: "#F0F8E8", text: "#FFFFFF" }, imagePath: kegImage("stella-artois"), kegId: "457" },
|
||||
{ slug: "stella-artois-unfiltered", name: "Stella Artois Unfiltered", brewery: "Brouwerij Artois", style: "Unfiltered Lager", abv: 5.0, colors: { primary: "#D4A547", secondary: "#FFFCE8", text: "#0E4C1E" }, imagePath: kegImage("stella-artois-unfiltered"), kegId: "43009" },
|
||||
{ slug: "stella-artois-0", name: "Stella Artois 0.0%", brewery: "Brouwerij Artois", style: "Non-Alcoholic Lager", abv: 0.0, colors: { primary: "#0E4C1E", secondary: "#F0F8E8", text: "#FFFFFF" }, imagePath: kegImage("stella-artois-0"), kegId: "47972" },
|
||||
|
||||
// === BELGIAN SPECIALITY ===
|
||||
{ slug: "kwak-rouge", name: "Kwak Rouge", brewery: "Brouwerij Bosteels", style: "Belgian Fruit Beer", abv: 8.0, colors: { primary: "#8B1A32", secondary: "#FFE8EE", text: "#FFFFFF" }, kegId: "42641" },
|
||||
{ slug: "palm", name: "Palm", brewery: "Brouwerij Palm", style: "Belgian Amber", abv: 5.2, colors: { primary: "#A85A1E", secondary: "#FFF2E2", text: "#FFFFFF" }, kegId: "42528" },
|
||||
{ slug: "ginette-blonde", name: "Ginette Bio Refreshing Blonde", brewery: "Brasserie Ginette", style: "Organic Belgian Blonde", abv: 5.0, colors: { primary: "#E8B93C", secondary: "#FFFBEA", text: "#1A0F00" }, kegId: "33642" },
|
||||
{ slug: "ginette-white", name: "Ginette Bio White", brewery: "Brasserie Ginette", style: "Organic Witbier", abv: 4.6, colors: { primary: "#CFD9C4", secondary: "#FCFDF8", text: "#2C3A22" }, kegId: "35344" },
|
||||
|
||||
// === LAGERS & PILSNERS ===
|
||||
{ slug: "budweiser", name: "Budweiser", brewery: "Anheuser-Busch", style: "American Lager", abv: 5.0, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" } },
|
||||
{ slug: "budweiser", name: "Budweiser", brewery: "Anheuser-Busch", style: "American Lager", abv: 5.0, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, kegId: "31747" },
|
||||
{ slug: "bud", name: "Anheuser-Busch Bud", brewery: "Anheuser-Busch", style: "American Lager", abv: 5.0, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("bud") },
|
||||
{ slug: "bud-light", name: "Bud Light", brewery: "Anheuser-Busch", style: "Light Lager", abv: 3.5, colors: { primary: "#004B8D", secondary: "#E8F4FF", text: "#FFFFFF" }, imagePath: kegImage("bud-light") },
|
||||
{ slug: "corona", name: "Corona Extra", brewery: "Grupo Modelo", style: "Mexican Lager", abv: 4.5, colors: { primary: "#FDB913", secondary: "#FFFCE5", text: "#00205B" }, imagePath: kegImage("corona") },
|
||||
{ slug: "corona-cero", name: "Corona Cero", brewery: "Grupo Modelo", style: "Non-Alcoholic Lager", abv: 0.0, colors: { primary: "#0073B1", secondary: "#E5F3FF", text: "#FFFFFF" }, imagePath: kegImage("corona-cero") },
|
||||
{ slug: "becks", name: "Beck's", brewery: "Brauerei Beck & Co", style: "German Pilsner", abv: 4.8, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("becks") },
|
||||
{ slug: "becks-gold", name: "Beck's Gold", brewery: "Brauerei Beck & Co", style: "German Lager", abv: 4.9, colors: { primary: "#D4A547", secondary: "#FFF8E0", text: "#006838" }, imagePath: kegImage("becks-gold") },
|
||||
{ slug: "peroni", name: "Peroni Nastro Azzurro", brewery: "Birra Peroni", style: "Italian Lager", abv: 5.1, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("peroni") },
|
||||
{ slug: "hertog-jan", name: "Hertog Jan", brewery: "AB InBev Netherlands", style: "Dutch Pilsner", abv: 5.1, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("hertog-jan") },
|
||||
{ slug: "hertog-jan-grand", name: "Hertog Jan Grand Pilsener", brewery: "AB InBev Netherlands", style: "Dutch Pilsner", abv: 5.1, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("hertog-jan-grand") },
|
||||
{ slug: "tennents", name: "Tennent's Lager", brewery: "Wellpark Brewery", style: "Scottish Lager", abv: 5.0, colors: { primary: "#D4001A", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("tennents") },
|
||||
{ slug: "la-virgen", name: "La Virgen Lager", brewery: "Cervezas La Virgen", style: "Spanish Lager", abv: 5.0, colors: { primary: "#1E6B3A", secondary: "#E8F5E0", text: "#FFFFFF" }, imagePath: kegImage("la-virgen") },
|
||||
{ slug: "san-miguel", name: "San Miguel", brewery: "San Miguel", style: "Spanish Lager", abv: 5.4, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("san-miguel") },
|
||||
{ slug: "victoria", name: "Victoria", brewery: "Victoria", style: "Spanish Lager", abv: 4.8, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("victoria") },
|
||||
{ slug: "samson", name: "Samson 11", brewery: "Samson", style: "Czech Lager", abv: 4.7, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("samson") },
|
||||
{ slug: "bud-light", name: "Bud Light", brewery: "Anheuser-Busch", style: "Light Lager", abv: 3.5, colors: { primary: "#004B8D", secondary: "#E8F4FF", text: "#FFFFFF" }, imagePath: kegImage("bud-light"), kegId: "42377" },
|
||||
{ slug: "corona", name: "Corona Extra", brewery: "Grupo Modelo", style: "Mexican Lager", abv: 4.5, colors: { primary: "#FDB913", secondary: "#FFFCE5", text: "#00205B" }, imagePath: kegImage("corona"), kegId: "34493" },
|
||||
{ slug: "corona-cero", name: "Corona Cero", brewery: "Grupo Modelo", style: "Non-Alcoholic Lager", abv: 0.0, colors: { primary: "#0073B1", secondary: "#E5F3FF", text: "#FFFFFF" }, imagePath: kegImage("corona-cero"), kegId: "43235" },
|
||||
{ slug: "becks", name: "Beck's", brewery: "Brauerei Beck & Co", style: "German Pilsner", abv: 4.8, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("becks"), kegId: "453" },
|
||||
{ slug: "becks-gold", name: "Beck's Gold", brewery: "Brauerei Beck & Co", style: "German Lager", abv: 4.9, colors: { primary: "#D4A547", secondary: "#FFF8E0", text: "#006838" }, imagePath: kegImage("becks-gold"), kegId: "452" },
|
||||
{ slug: "peroni", name: "Peroni Nastro Azzurro", brewery: "Birra Peroni", style: "Italian Lager", abv: 5.1, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("peroni"), kegId: "47384" },
|
||||
{ slug: "hertog-jan", name: "Hertog Jan", brewery: "AB InBev Netherlands", style: "Dutch Pilsner", abv: 5.1, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("hertog-jan"), kegId: "2073" },
|
||||
{ slug: "hertog-jan-grand", name: "Hertog Jan Grand Pilsener", brewery: "AB InBev Netherlands", style: "Dutch Pilsner", abv: 5.1, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("hertog-jan-grand"), kegId: "44040" },
|
||||
{ slug: "tennents", name: "Tennent's Lager", brewery: "Wellpark Brewery", style: "Scottish Lager", abv: 5.0, colors: { primary: "#D4001A", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("tennents"), kegId: "36302" },
|
||||
{ slug: "la-virgen", name: "La Virgen Lager", brewery: "Cervezas La Virgen", style: "Spanish Lager", abv: 5.0, colors: { primary: "#1E6B3A", secondary: "#E8F5E0", text: "#FFFFFF" }, imagePath: kegImage("la-virgen"), kegId: "33515" },
|
||||
{ slug: "san-miguel", name: "San Miguel", brewery: "San Miguel", style: "Spanish Lager", abv: 5.4, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("san-miguel"), kegId: "44059" },
|
||||
{ slug: "victoria", name: "Victoria", brewery: "Victoria", style: "Spanish Lager", abv: 4.8, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#D4A547" }, imagePath: kegImage("victoria"), kegId: "42223" },
|
||||
{ slug: "samson", name: "Samson 11", brewery: "Samson", style: "Czech Lager", abv: 4.7, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("samson"), kegId: "47984" },
|
||||
|
||||
{ slug: "diekirch-premium", name: "Diekirch Premium", brewery: "Brasserie de Luxembourg", style: "Luxembourg Pilsner", abv: 4.8, colors: { primary: "#A81C24", secondary: "#FFF0EE", text: "#FFFFFF" }, kegId: "760" },
|
||||
{ slug: "diekirch-grand-cru", name: "Diekirch Grand Cru", brewery: "Brasserie de Luxembourg", style: "Strong Lager", abv: 6.9, colors: { primary: "#8C1319", secondary: "#FFEFEC", text: "#F0D080" }, kegId: "759" },
|
||||
{ slug: "diekirch-christmas", name: "Diekirch Christmas", brewery: "Brasserie de Luxembourg", style: "Winter Lager", abv: 5.2, colors: { primary: "#7A1520", secondary: "#FFEEEE", text: "#F0D080" }, kegId: "1470" },
|
||||
{ slug: "chernigivske", name: "Chernigivske", brewery: "Chernigivske", style: "Ukrainian Lager", abv: 4.8, colors: { primary: "#0B5FA5", secondary: "#E8F2FC", text: "#FFFFFF" }, kegId: "42415" },
|
||||
{ slug: "corona-ligera", name: "Corona Ligera", brewery: "Grupo Modelo", style: "Light Mexican Lager", abv: 3.8, colors: { primary: "#5AA8D8", secondary: "#EAF6FD", text: "#00205B" }, kegId: "47816" },
|
||||
{ slug: "via-roma", name: "Via Roma", brewery: "Via Roma", style: "Italian Lager", abv: 5.0, colors: { primary: "#1E6B4A", secondary: "#E9F5EF", text: "#FFFFFF" }, kegId: "44543" },
|
||||
{ slug: "romola", name: "Romola", brewery: "Romola", style: "Italian Lager", abv: 5.0, colors: { primary: "#8B1A2B", secondary: "#FFF0F2", text: "#F0D8A0" }, kegId: "32814" },
|
||||
{ slug: "hertog-jan-bock", name: "Hertog Jan Bockbier", brewery: "AB InBev Netherlands", style: "Dutch Bock", abv: 6.5, colors: { primary: "#3A1C0A", secondary: "#F2E4D4", text: "#D4A547" }, kegId: "43033" },
|
||||
|
||||
// === GERMAN BEERS ===
|
||||
{ slug: "franziskaner", name: "Franziskaner Weissbier", brewery: "Spaten-Franziskaner-Bräu", style: "Hefeweizen", abv: 5.0, colors: { primary: "#2E5090", secondary: "#E8F0FF", text: "#F5C242" }, imagePath: kegImage("franziskaner") },
|
||||
{ slug: "franziskaner-royal", name: "Franziskaner Royal", brewery: "Spaten-Franziskaner-Bräu", style: "Weissbier", abv: 6.0, colors: { primary: "#1A1A5C", secondary: "#E0E0F8", text: "#F5C242" }, imagePath: kegImage("franziskaner-royal") },
|
||||
{ slug: "franziskaner-kellerbier", name: "Franziskaner Kellerbier", brewery: "Spaten-Franziskaner-Bräu", style: "Kellerbier", abv: 5.2, colors: { primary: "#6B4423", secondary: "#F5E6D0", text: "#F5C242" }, imagePath: kegImage("franziskaner-kellerbier") },
|
||||
{ slug: "spaten", name: "Spaten", brewery: "Spaten-Franziskaner-Bräu", style: "Munich Helles", abv: 5.2, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#FFFFFF" }, imagePath: kegImage("spaten") },
|
||||
{ slug: "lowenbrau", name: "Löwenbräu", brewery: "Löwenbräu", style: "Munich Helles", abv: 5.2, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("lowenbrau") },
|
||||
{ slug: "hasseroder", name: "Hasseröder Premium", brewery: "Hasseröder Brauerei", style: "German Pilsner", abv: 4.9, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("hasseroder") },
|
||||
{ slug: "diebels", name: "Diebels Alt", brewery: "Brauerei Diebels", style: "Altbier", abv: 4.9, colors: { primary: "#4A2810", secondary: "#F5E6D0", text: "#FFFFFF" }, imagePath: kegImage("diebels") },
|
||||
{ slug: "schneider", name: "Schneider Bayrisch Hell", brewery: "G. Schneider & Sohn", style: "Bavarian Helles", abv: 5.2, colors: { primary: "#006838", secondary: "#E8F5E0", text: "#FFFFFF" }, imagePath: kegImage("schneider") },
|
||||
{ slug: "haake-beck", name: "Haake-Beck", brewery: "Brauerei Beck & Co", style: "German Pilsner", abv: 4.9, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("haake-beck") },
|
||||
{ slug: "fruh-kolsch", name: "Früh Kölsch", brewery: "Cölner Hofbräu Früh", style: "Kölsch", abv: 4.8, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("fruh-kolsch") },
|
||||
{ slug: "franziskaner", name: "Franziskaner Weissbier", brewery: "Spaten-Franziskaner-Bräu", style: "Hefeweizen", abv: 5.0, colors: { primary: "#2E5090", secondary: "#E8F0FF", text: "#F5C242" }, imagePath: kegImage("franziskaner"), kegId: "455" },
|
||||
{ slug: "franziskaner-royal", name: "Franziskaner Royal", brewery: "Spaten-Franziskaner-Bräu", style: "Weissbier", abv: 6.0, colors: { primary: "#1A1A5C", secondary: "#E0E0F8", text: "#F5C242" }, imagePath: kegImage("franziskaner-royal"), kegId: "30955" },
|
||||
{ slug: "franziskaner-kellerbier", name: "Franziskaner Kellerbier", brewery: "Spaten-Franziskaner-Bräu", style: "Kellerbier", abv: 5.2, colors: { primary: "#6B4423", secondary: "#F5E6D0", text: "#F5C242" }, imagePath: kegImage("franziskaner-kellerbier"), kegId: "44452" },
|
||||
{ slug: "spaten", name: "Spaten", brewery: "Spaten-Franziskaner-Bräu", style: "Munich Helles", abv: 5.2, colors: { primary: "#1A3C0A", secondary: "#E8F0E0", text: "#FFFFFF" }, imagePath: kegImage("spaten"), kegId: "29974" },
|
||||
{ slug: "lowenbrau", name: "Löwenbräu", brewery: "Löwenbräu", style: "Munich Helles", abv: 5.2, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("lowenbrau"), kegId: "454" },
|
||||
{ slug: "hasseroder", name: "Hasseröder Premium", brewery: "Hasseröder Brauerei", style: "German Pilsner", abv: 4.9, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("hasseroder"), kegId: "500" },
|
||||
{ slug: "diebels", name: "Diebels Alt", brewery: "Brauerei Diebels", style: "Altbier", abv: 4.9, colors: { primary: "#4A2810", secondary: "#F5E6D0", text: "#FFFFFF" }, imagePath: kegImage("diebels"), kegId: "456" },
|
||||
{ slug: "schneider", name: "Schneider Bayrisch Hell", brewery: "G. Schneider & Sohn", style: "Bavarian Helles", abv: 5.2, colors: { primary: "#006838", secondary: "#E8F5E0", text: "#FFFFFF" }, imagePath: kegImage("schneider"), kegId: "41588" },
|
||||
{ slug: "haake-beck", name: "Haake-Beck", brewery: "Brauerei Beck & Co", style: "German Pilsner", abv: 4.9, colors: { primary: "#006838", secondary: "#E0F5E8", text: "#FFFFFF" }, imagePath: kegImage("haake-beck"), kegId: "47144" },
|
||||
{ slug: "fruh-kolsch", name: "Früh Kölsch", brewery: "Cölner Hofbräu Früh", style: "Kölsch", abv: 4.8, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("fruh-kolsch"), kegId: "47977" },
|
||||
|
||||
{ slug: "lowenbrau-oktoberfest", name: "Löwenbräu Oktoberfestbier", brewery: "Löwenbräu", style: "Märzen", abv: 6.1, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#F5C242" }, kegId: "29745" },
|
||||
{ slug: "spaten-oktoberfest", name: "Spaten Oktoberfestbier", brewery: "Spaten-Franziskaner-Bräu", style: "Märzen", abv: 5.9, colors: { primary: "#A8641E", secondary: "#FFF2E0", text: "#FFFFFF" }, kegId: "33918" },
|
||||
|
||||
// === CRAFT & IPA ===
|
||||
{ slug: "goose-island-ipa", name: "Goose Island IPA", brewery: "Goose Island", style: "India Pale Ale", abv: 5.9, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("goose-island-ipa") },
|
||||
{ slug: "goose-island-ipa", name: "Goose Island IPA", brewery: "Goose Island", style: "India Pale Ale", abv: 5.9, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("goose-island-ipa"), kegId: "32816" },
|
||||
{ slug: "goose-island-hazy", name: "Goose Island Hazy Beer Hug", brewery: "Goose Island", style: "Hazy IPA", abv: 6.4, colors: { primary: "#F5A623", secondary: "#FFFAE5", text: "#2C1A00" } },
|
||||
{ slug: "goose-midway", name: "Goose Midway Session IPA", brewery: "Goose Island", style: "Session IPA", abv: 4.1, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("goose-midway") },
|
||||
{ slug: "brewdog-punk-ipa", name: "BrewDog Punk IPA", brewery: "BrewDog", style: "India Pale Ale", abv: 5.4, colors: { primary: "#00A3E0", secondary: "#E5F5FF", text: "#FFFFFF" }, imagePath: kegImage("brewdog-punk-ipa") },
|
||||
{ slug: "brewdog-elvis-juice", name: "BrewDog Elvis Juice", brewery: "BrewDog", style: "Grapefruit IPA", abv: 6.5, colors: { primary: "#FF6B1A", secondary: "#FFF3E5", text: "#1A1A1A" }, imagePath: kegImage("brewdog-elvis-juice") },
|
||||
{ slug: "camden-hells", name: "Camden Hells", brewery: "Camden Town Brewery", style: "Helles Lager", abv: 4.6, colors: { primary: "#000000", secondary: "#F5F0E0", text: "#F5C242" }, imagePath: kegImage("camden-hells") },
|
||||
{ slug: "camden-pale", name: "Camden Pale Ale", brewery: "Camden Town Brewery", style: "Pale Ale", abv: 4.0, colors: { primary: "#E87D00", secondary: "#FFF5E5", text: "#000000" }, imagePath: kegImage("camden-pale") },
|
||||
{ slug: "camden-ipa", name: "Camden IPA", brewery: "Camden Town Brewery", style: "India Pale Ale", abv: 5.8, colors: { primary: "#2E8B57", secondary: "#E5F5EC", text: "#FFFFFF" }, imagePath: kegImage("camden-ipa") },
|
||||
{ slug: "camden-eazy", name: "Camden Eazy", brewery: "Camden Town Brewery", style: "Session Pale", abv: 4.0, colors: { primary: "#F5C242", secondary: "#FFFCE5", text: "#000000" }, imagePath: kegImage("camden-eazy") },
|
||||
{ slug: "tiny-rebel-clwb", name: "Tiny Rebel Clwb Tropicana", brewery: "Tiny Rebel", style: "Tropical IPA", abv: 5.5, colors: { primary: "#FF3399", secondary: "#FFE5F2", text: "#1A1A1A" }, imagePath: kegImage("tiny-rebel-clwb") },
|
||||
{ slug: "vocation-life-death", name: "Vocation Life & Death", brewery: "Vocation Brewery", style: "India Pale Ale", abv: 6.5, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#D4001A" }, imagePath: kegImage("vocation-life-death") },
|
||||
{ slug: "goose-midway", name: "Goose Midway Session IPA", brewery: "Goose Island", style: "Session IPA", abv: 4.1, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("goose-midway"), kegId: "29775" },
|
||||
{ slug: "brewdog-punk-ipa", name: "BrewDog Punk IPA", brewery: "BrewDog", style: "India Pale Ale", abv: 5.4, colors: { primary: "#00A3E0", secondary: "#E5F5FF", text: "#FFFFFF" }, imagePath: kegImage("brewdog-punk-ipa"), kegId: "41830" },
|
||||
{ slug: "brewdog-elvis-juice", name: "BrewDog Elvis Juice", brewery: "BrewDog", style: "Grapefruit IPA", abv: 6.5, colors: { primary: "#FF6B1A", secondary: "#FFF3E5", text: "#1A1A1A" }, imagePath: kegImage("brewdog-elvis-juice"), kegId: "42703" },
|
||||
{ slug: "camden-hells", name: "Camden Hells", brewery: "Camden Town Brewery", style: "Helles Lager", abv: 4.6, colors: { primary: "#000000", secondary: "#F5F0E0", text: "#F5C242" }, imagePath: kegImage("camden-hells"), kegId: "43006" },
|
||||
{ slug: "camden-pale", name: "Camden Pale Ale", brewery: "Camden Town Brewery", style: "Pale Ale", abv: 4.0, colors: { primary: "#E87D00", secondary: "#FFF5E5", text: "#000000" }, imagePath: kegImage("camden-pale"), kegId: "43805" },
|
||||
{ slug: "camden-ipa", name: "Camden IPA", brewery: "Camden Town Brewery", style: "India Pale Ale", abv: 5.8, colors: { primary: "#2E8B57", secondary: "#E5F5EC", text: "#FFFFFF" }, imagePath: kegImage("camden-ipa"), kegId: "44425" },
|
||||
{ slug: "camden-eazy", name: "Camden Eazy", brewery: "Camden Town Brewery", style: "Session Pale", abv: 4.0, colors: { primary: "#F5C242", secondary: "#FFFCE5", text: "#000000" }, imagePath: kegImage("camden-eazy"), kegId: "47629" },
|
||||
{ slug: "tiny-rebel-clwb", name: "Tiny Rebel Clwb Tropicana", brewery: "Tiny Rebel", style: "Tropical IPA", abv: 5.5, colors: { primary: "#FF3399", secondary: "#FFE5F2", text: "#1A1A1A" }, imagePath: kegImage("tiny-rebel-clwb"), kegId: "33917" },
|
||||
{ slug: "vocation-life-death", name: "Vocation Life & Death", brewery: "Vocation Brewery", style: "India Pale Ale", abv: 6.5, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#D4001A" }, imagePath: kegImage("vocation-life-death"), kegId: "42526" },
|
||||
{ slug: "vocation-hop-skip", name: "Vocation Hop, Skip & Juice", brewery: "Vocation Brewery", style: "Pale Ale", abv: 5.7, colors: { primary: "#F5A623", secondary: "#FFFAE5", text: "#1A1A1A" }, imagePath: kegImage("vocation-hop-skip") },
|
||||
{ slug: "thornbridge-jaipur", name: "Thornbridge Jaipur", brewery: "Thornbridge Brewery", style: "India Pale Ale", abv: 5.9, colors: { primary: "#8B4513", secondary: "#FFF5EB", text: "#FFFFFF" }, imagePath: kegImage("thornbridge-jaipur") },
|
||||
{ slug: "ninkasi", name: "Ninkasi IPA", brewery: "Ninkasi Brasserie", style: "India Pale Ale", abv: 5.4, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("ninkasi") },
|
||||
{ slug: "thornbridge-jaipur", name: "Thornbridge Jaipur", brewery: "Thornbridge Brewery", style: "India Pale Ale", abv: 5.9, colors: { primary: "#8B4513", secondary: "#FFF5EB", text: "#FFFFFF" }, imagePath: kegImage("thornbridge-jaipur"), kegId: "34327" },
|
||||
{ slug: "ninkasi", name: "Ninkasi IPA", brewery: "Ninkasi Brasserie", style: "India Pale Ale", abv: 5.4, colors: { primary: "#D45500", secondary: "#FFF2E5", text: "#FFFFFF" }, imagePath: kegImage("ninkasi"), kegId: "47440" },
|
||||
|
||||
{ slug: "goose-golden", name: "Goose Island Golden Goose", brewery: "Goose Island", style: "Golden Ale", abv: 4.6, colors: { primary: "#E0A82E", secondary: "#FFF8E6", text: "#2C1A00" }, kegId: "35168" },
|
||||
{ slug: "tiny-rebel-pineapple", name: "Tiny Rebel Pineapple Express IPA", brewery: "Tiny Rebel", style: "Tropical IPA", abv: 5.5, colors: { primary: "#F2A33C", secondary: "#FFF6E8", text: "#1A1A1A" }, kegId: "36703" },
|
||||
{ slug: "tiny-rebel-cali", name: "Tiny Rebel Cali Pale", brewery: "Tiny Rebel", style: "Pale Ale", abv: 4.9, colors: { primary: "#2AA8C4", secondary: "#E8F7FB", text: "#1A1A1A" }, kegId: "37005" },
|
||||
{ slug: "tiny-rebel-stay-puft", name: "Tiny Rebel Stay Puft", brewery: "Tiny Rebel", style: "Marshmallow Porter", abv: 5.2, colors: { primary: "#2A1408", secondary: "#F2E6DA", text: "#F5D9B0" }, kegId: "44536" },
|
||||
{ slug: "crew-republic-drunken-sailor", name: "Crew Republic Drunken Sailor", brewery: "Crew Republic", style: "Session IPA", abv: 4.2, colors: { primary: "#1A2A4A", secondary: "#E8EDF5", text: "#E8B93C" }, kegId: "37038" },
|
||||
{ slug: "mikkeller-heated-seats", name: "Mikkeller Heated Seats", brewery: "Mikkeller", style: "India Pale Ale", abv: 5.5, colors: { primary: "#E85A8A", secondary: "#FFEDF3", text: "#1A1A1A" }, kegId: "41832" },
|
||||
{ slug: "mikkeller-got", name: "Mikkeller Game of Thrones", brewery: "Mikkeller", style: "India Pale Ale", abv: 6.0, colors: { primary: "#1A1A1A", secondary: "#ECECEC", text: "#C9A24D" }, kegId: "42778" },
|
||||
{ slug: "magic-rock-orange", name: "Magic Rock Magic Orange", brewery: "Magic Rock Brewing", style: "Pale Ale", abv: 4.4, colors: { primary: "#E8701A", secondary: "#FFF3E8", text: "#1A1A1A" }, kegId: "43806" },
|
||||
{ slug: "brewdog-lost-lager", name: "BrewDog Lost Lager", brewery: "BrewDog", style: "Pilsner", abv: 4.5, colors: { primary: "#2E7D5B", secondary: "#E9F5EF", text: "#FFFFFF" }, kegId: "43807" },
|
||||
{ slug: "brewdog-hopped-harmony", name: "BrewDog Hopped in Harmony", brewery: "BrewDog", style: "Session IPA", abv: 4.2, colors: { primary: "#7FBF3F", secondary: "#F2FAE8", text: "#1A1A1A" }, kegId: "44238" },
|
||||
{ slug: "ninkasi-flower", name: "Ninkasi Flower Lager", brewery: "Ninkasi Brasserie", style: "Dry-Hopped Lager", abv: 4.8, colors: { primary: "#B8C43C", secondary: "#F7FAE6", text: "#2C1A00" }, kegId: "44331" },
|
||||
{ slug: "camden-marzen", name: "Camden Märzen", brewery: "Camden Town Brewery", style: "Märzen", abv: 5.4, colors: { primary: "#B5651D", secondary: "#FFF2E2", text: "#F5C242" }, kegId: "44474" },
|
||||
{ slug: "camden-lager-top", name: "Camden Lager Top", brewery: "Camden Town Brewery", style: "Shandy", abv: 2.8, colors: { primary: "#E8C93C", secondary: "#FFFCE8", text: "#000000" }, kegId: "47429" },
|
||||
|
||||
// === ENGLISH & SCOTTISH ===
|
||||
{ slug: "fullers-london-pride", name: "Fuller's London Pride", brewery: "Fuller's", style: "English Bitter", abv: 4.7, colors: { primary: "#7B241C", secondary: "#F5E6E0", text: "#FFFFFF" }, imagePath: kegImage("fullers-london-pride") },
|
||||
{ slug: "hawkstone", name: "Hawkstone Lager", brewery: "Hawkstone Brewing", style: "English Lager", abv: 4.8, colors: { primary: "#3D6B35", secondary: "#E8F0E0", text: "#F5E6C8" } },
|
||||
{ slug: "old-peculier", name: "Theakston Old Peculier", brewery: "Theakston Brewery", style: "Old Ale", abv: 5.6, colors: { primary: "#2C0A1E", secondary: "#F0E0E8", text: "#C8922A" }, imagePath: kegImage("old-peculier") },
|
||||
{ slug: "adnams", name: "Adnams Ghost Ship", brewery: "Adnams", style: "Pale Ale", abv: 4.5, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" } },
|
||||
{ slug: "old-speckled-hen", name: "Old Speckled Hen", brewery: "Greene King", style: "English Bitter", abv: 5.0, colors: { primary: "#8B4513", secondary: "#FFF5EB", text: "#FFFFFF" }, imagePath: kegImage("old-speckled-hen") },
|
||||
{ slug: "northern-monk", name: "Northern Monk A Little Faith", brewery: "Northern Monk", style: "Session Pale", abv: 4.0, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#F5C242" }, imagePath: kegImage("northern-monk") },
|
||||
{ slug: "st-austell", name: "St Austell Proper Job IPA", brewery: "St Austell", style: "India Pale Ale", abv: 5.5, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("st-austell") },
|
||||
{ slug: "trooper", name: "Trooper Original", brewery: "Robinsons", style: "English Bitter", abv: 4.7, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#C8102E" }, imagePath: kegImage("trooper") },
|
||||
{ slug: "fullers-london-pride", name: "Fuller's London Pride", brewery: "Fuller's", style: "English Bitter", abv: 4.7, colors: { primary: "#7B241C", secondary: "#F5E6E0", text: "#FFFFFF" }, imagePath: kegImage("fullers-london-pride"), kegId: "47943" },
|
||||
{ slug: "bass", name: "Bass Pale Ale", brewery: "Bass", style: "English Pale Ale", abv: 4.4, colors: { primary: "#E31837", secondary: "#FFF2F2", text: "#FFFFFF" }, kegId: "47962" },
|
||||
{ slug: "hawkstone", name: "Hawkstone Lager", brewery: "Hawkstone Brewing", style: "English Lager", abv: 4.8, colors: { primary: "#3D6B35", secondary: "#E8F0E0", text: "#F5E6C8" }, kegId: "43019" },
|
||||
{ slug: "old-peculier", name: "Theakston Old Peculier", brewery: "Theakston Brewery", style: "Old Ale", abv: 5.6, colors: { primary: "#2C0A1E", secondary: "#F0E0E8", text: "#C8922A" }, imagePath: kegImage("old-peculier"), kegId: "47285" },
|
||||
{ slug: "adnams", name: "Adnams Ghost Ship", brewery: "Adnams", style: "Pale Ale", abv: 4.5, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, kegId: "42920" },
|
||||
{ slug: "old-speckled-hen", name: "Old Speckled Hen", brewery: "Greene King", style: "English Bitter", abv: 5.0, colors: { primary: "#8B4513", secondary: "#FFF5EB", text: "#FFFFFF" }, imagePath: kegImage("old-speckled-hen"), kegId: "47774" },
|
||||
{ slug: "northern-monk", name: "Northern Monk A Little Faith", brewery: "Northern Monk", style: "Session Pale", abv: 4.0, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#F5C242" }, imagePath: kegImage("northern-monk"), kegId: "47389" },
|
||||
{ slug: "northern-monk-faith", name: "Northern Monk Faith", brewery: "Northern Monk", style: "Pale Ale", abv: 5.4, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#F5C242" }, imagePath: kegImage("northern-monk"), kegId: "48061" },
|
||||
{ slug: "st-austell", name: "St Austell Proper Job IPA", brewery: "St Austell", style: "India Pale Ale", abv: 5.5, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, imagePath: kegImage("st-austell"), kegId: "47494" },
|
||||
{ slug: "trooper", name: "Trooper Original", brewery: "Robinsons", style: "English Bitter", abv: 4.7, colors: { primary: "#1A1A1A", secondary: "#F0F0F0", text: "#C8102E" }, imagePath: kegImage("trooper"), kegId: "47973" },
|
||||
{ slug: "innis-gunn-lager", name: "Innis & Gunn Lager Beer", brewery: "Innis & Gunn", style: "Scottish Lager", abv: 4.6, colors: { primary: "#0E3A5C", secondary: "#E8F0F7", text: "#D4A547" }, kegId: "42756" },
|
||||
|
||||
// === CIDERS ===
|
||||
{ slug: "orchard-pig-reveller", name: "Orchard Pig Reveller Cider", brewery: "Orchard Pig", style: "Cider", abv: 4.5, colors: { primary: "#D4405A", secondary: "#FFEFF2", text: "#FFFFFF" }, kegId: "42876" },
|
||||
{ slug: "kopparberg-crisp-apple", name: "Kopparberg Crisp Apple", brewery: "Kopparberg", style: "Fruit Cider", abv: 4.5, colors: { primary: "#7FB53F", secondary: "#F2FAE8", text: "#FFFFFF" }, kegId: "48134" },
|
||||
|
||||
// === FRENCH ===
|
||||
{ slug: "castelain", name: "Castelain Grand Cru", brewery: "Brasserie Castelain", style: "Bière de Garde", abv: 6.2, colors: { primary: "#8B6914", secondary: "#FFF8E0", text: "#FFFFFF" }, imagePath: kegImage("castelain") },
|
||||
{ slug: "castelain-chti", name: "Castelain Ch'ti Blonde", brewery: "Brasserie Castelain", style: "Bière de Garde", abv: 6.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#1A0F00" }, imagePath: kegImage("castelain-chti") },
|
||||
{ slug: "meteor", name: "Meteor White IPA", brewery: "Brasserie Meteor", style: "White IPA", abv: 5.6, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("meteor") },
|
||||
{ slug: "anoesteke", name: "Anosteké Blonde", brewery: "Brasserie du Pays Flamand", style: "French Blonde", abv: 8.0, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#1A0F00" }, imagePath: kegImage("anoesteke") },
|
||||
{ slug: "rousse-mont-blanc", name: "Rousse du Mont Blanc", brewery: "Brasserie du Mont Blanc", style: "French Amber", abv: 6.5, colors: { primary: "#B5651D", secondary: "#FFF0D6", text: "#FFFFFF" }, imagePath: kegImage("rousse-mont-blanc") },
|
||||
{ slug: "castelain", name: "Castelain Grand Cru", brewery: "Brasserie Castelain", style: "Bière de Garde", abv: 6.2, colors: { primary: "#8B6914", secondary: "#FFF8E0", text: "#FFFFFF" }, imagePath: kegImage("castelain"), kegId: "42527" },
|
||||
{ slug: "castelain-chti", name: "Castelain Ch'ti Blonde", brewery: "Brasserie Castelain", style: "Bière de Garde", abv: 6.4, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#1A0F00" }, imagePath: kegImage("castelain-chti"), kegId: "47974" },
|
||||
{ slug: "meteor", name: "Meteor White IPA", brewery: "Brasserie Meteor", style: "White IPA", abv: 5.6, colors: { primary: "#003DA5", secondary: "#E8F0FF", text: "#FFFFFF" }, imagePath: kegImage("meteor"), kegId: "47486" },
|
||||
{ slug: "anoesteke", name: "Anosteké Blonde", brewery: "Brasserie du Pays Flamand", style: "French Blonde", abv: 8.0, colors: { primary: "#D4A547", secondary: "#FFF8E8", text: "#1A0F00" }, imagePath: kegImage("anoesteke"), kegId: "47523" },
|
||||
{ slug: "rousse-mont-blanc", name: "Rousse du Mont Blanc", brewery: "Brasserie du Mont Blanc", style: "French Amber", abv: 6.5, colors: { primary: "#B5651D", secondary: "#FFF0D6", text: "#FFFFFF" }, imagePath: kegImage("rousse-mont-blanc"), kegId: "44387" },
|
||||
|
||||
// === NON-BEER ===
|
||||
// Merchandise the machine can report as the active "keg". Present as itself
|
||||
// rather than dressed up as a beer.
|
||||
{ slug: "stein-1l", name: "1L Stein", brewery: "PerfectDraft", style: "Merchandise", abv: 0.0, colors: { primary: "#6B7280", secondary: "#F1F3F5", text: "#FFFFFF" }, kegId: "42863" },
|
||||
|
||||
// === CUSTOM / FALLBACK ===
|
||||
{ slug: "modelo", name: "Modelo Especial", brewery: "Grupo Modelo", style: "Mexican Lager", abv: 4.5, colors: { primary: "#B8860B", secondary: "#FFF8E8", text: "#1A0F00" }, kegId: "47979" },
|
||||
{ slug: "mahou", name: "Mahou", brewery: "Mahou", style: "Spanish Lager", abv: 4.8, colors: { primary: "#C8102E", secondary: "#FFF0F0", text: "#FFFFFF" }, kegId: "44526" },
|
||||
{ slug: "la-chouffe", name: "La Chouffe Blonde", brewery: "Brasserie d'Achouffe", style: "Belgian Blonde", abv: 8.0, colors: { primary: "#C0392B", secondary: "#FFF2EE", text: "#FFFFFF" }, kegId: "47986" },
|
||||
{ slug: "siren-lumina", name: "Siren Lumina IPA", brewery: "Siren Craft Brew", style: "Session IPA", abv: 4.2, colors: { primary: "#1F8A8A", secondary: "#E0F5F5", text: "#FFFFFF" }, kegId: "48024" },
|
||||
{ slug: "singha", name: "Singha", brewery: "Boon Rawd Brewery", style: "Thai Lager", abv: 5.0, colors: { primary: "#8B1A1A", secondary: "#FFF3E0", text: "#E8C86E" }, kegId: "47418" },
|
||||
{ slug: "thatchers-gold", name: "Thatchers Gold", brewery: "Thatchers", style: "Cider", abv: 4.8, colors: { primary: "#D4A017", secondary: "#FFFBEA", text: "#3A2A00" }, kegId: "47999" },
|
||||
{ slug: "kopparberg-strawberry-lime", name: "Kopparberg Strawberry & Lime", brewery: "Kopparberg", style: "Fruit Cider", abv: 4.0, colors: { primary: "#E4405F", secondary: "#FFF0F3", text: "#FFFFFF" }, kegId: "44090" },
|
||||
{ slug: "custom", name: "Custom Beer", brewery: "Unknown", style: "Beer", abv: 5.0, colors: { primary: "#555555", secondary: "#F0F0F0", text: "#FFFFFF" } },
|
||||
];
|
||||
|
||||
const slugIndex = new Map<string, BeerEntry>();
|
||||
const nameIndex = new Map<string, BeerEntry>();
|
||||
const kegIdIndex = new Map<string, BeerEntry>();
|
||||
for (const beer of CATALOG) {
|
||||
slugIndex.set(beer.slug, beer);
|
||||
nameIndex.set(beer.name.toLowerCase(), beer);
|
||||
if (beer.kegId) kegIdIndex.set(beer.kegId, beer);
|
||||
}
|
||||
|
||||
export function getBeerBySlug(slug: string): BeerEntry | undefined {
|
||||
@@ -137,6 +194,11 @@ export function getBeerByName(name: string): BeerEntry | undefined {
|
||||
return nameIndex.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
export function getBeerByKegId(kegId: string | undefined): BeerEntry | undefined {
|
||||
if (!kegId) return undefined;
|
||||
return kegIdIndex.get(kegId);
|
||||
}
|
||||
|
||||
export function getAllBeers(): BeerEntry[] {
|
||||
return CATALOG.filter((b) => b.slug !== "custom");
|
||||
}
|
||||
@@ -189,5 +251,8 @@ export function resolveBeer(
|
||||
slug: beerName.toLowerCase().replace(/\s+/g, "-"),
|
||||
};
|
||||
}
|
||||
return getAllBeers()[0];
|
||||
// With no name to resolve there is nothing to identify, so return the neutral
|
||||
// entry. Returning a real catalog entry here would make the card claim a beer
|
||||
// it has not detected.
|
||||
return getCustomFallback();
|
||||
}
|
||||
|
||||
+34
-29
@@ -5,7 +5,7 @@ import type { PerfectDraftCardConfig } from "./types.js";
|
||||
import { GLASS_SIZES, DEFAULT_GLASS_SIZE, DOMAIN, LAYOUTS, DEFAULT_LAYOUT } from "./const.js";
|
||||
import { getAllBeers } from "./beer-catalog.js";
|
||||
|
||||
const EDITOR_VERSION = "0.2.0";
|
||||
const EDITOR_VERSION = "0.3.1";
|
||||
|
||||
interface DiscoveredDevice {
|
||||
deviceId: string;
|
||||
@@ -74,8 +74,6 @@ export class PerfectDraftCardEditor extends LitElement {
|
||||
return html`<div>Loading...</div>`;
|
||||
}
|
||||
|
||||
const allBeers = getAllBeers();
|
||||
|
||||
return html`
|
||||
<div class="editor">
|
||||
<div class="version">PerfectDraft Card Editor v${EDITOR_VERSION} · ${this._devices.length} device(s) found</div>
|
||||
@@ -101,22 +99,6 @@ export class PerfectDraftCardEditor extends LitElement {
|
||||
`
|
||||
}
|
||||
|
||||
<div class="field">
|
||||
<label>Default Beer</label>
|
||||
<select
|
||||
.value=${this._config.beer_name ?? ""}
|
||||
@change=${(e: Event) => this._updateConfig("beer_name", (e.target as HTMLSelectElement).value)}
|
||||
>
|
||||
${allBeers.map(
|
||||
(b) => html`
|
||||
<option value=${b.name} ?selected=${this._config.beer_name === b.name}>
|
||||
${b.name} (${b.brewery})
|
||||
</option>
|
||||
`,
|
||||
)}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Default Glass Size</label>
|
||||
<select
|
||||
@@ -149,6 +131,34 @@ export class PerfectDraftCardEditor extends LitElement {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Beer override</label>
|
||||
<select
|
||||
.value=${this._config.beer_name ?? ""}
|
||||
@change=${(e: Event) =>
|
||||
this._updateConfig("beer_name", (e.target as HTMLSelectElement).value || undefined)}
|
||||
>
|
||||
<option value="" ?selected=${!this._config.beer_name}>Auto-detect from the machine</option>
|
||||
${getAllBeers().map(
|
||||
(b) => html`
|
||||
<option value=${b.name} ?selected=${this._config.beer_name === b.name}>
|
||||
${b.name} (${b.brewery})
|
||||
</option>
|
||||
`,
|
||||
)}
|
||||
${(this._config.custom_beers ?? []).map(
|
||||
(cb) => html`
|
||||
<option value=${cb.name} ?selected=${this._config.beer_name === cb.name}>
|
||||
${cb.name} (custom)
|
||||
</option>
|
||||
`,
|
||||
)}
|
||||
</select>
|
||||
<div class="hint">
|
||||
Leave on auto-detect. Only set this if your keg is not recognised or is shown wrongly.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="advanced-heading">Emoji matrix (advanced)</div>
|
||||
|
||||
<div class="field">
|
||||
@@ -178,16 +188,6 @@ export class PerfectDraftCardEditor extends LitElement {
|
||||
@input=${(e: InputEvent) => this._updateConfig("max_matrix_width", (e.target as HTMLInputElement).value || undefined)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Beer Entity (optional — for automatic beer detection)</label>
|
||||
<input
|
||||
type="text"
|
||||
.value=${this._config.beer_entity ?? ""}
|
||||
placeholder="sensor.perfectdraft_pro_keg_name"
|
||||
@input=${(e: InputEvent) => this._updateConfig("beer_entity", (e.target as HTMLInputElement).value || undefined)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -223,6 +223,11 @@ export class PerfectDraftCardEditor extends LitElement {
|
||||
text-align: right;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.hint {
|
||||
font-size: 0.8em;
|
||||
opacity: 0.55;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.advanced-heading {
|
||||
font-size: 0.8em;
|
||||
text-transform: uppercase;
|
||||
|
||||
+115
-104
@@ -1,4 +1,4 @@
|
||||
import { LitElement, html, css, nothing, type CSSResultGroup, type TemplateResult } from "lit";
|
||||
import { LitElement, html, css, nothing, type CSSResultGroup, type PropertyValues, type TemplateResult } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators.js";
|
||||
|
||||
import type { PerfectDraftCardConfig, CardLayout } from "./types.js";
|
||||
@@ -15,13 +15,20 @@ import {
|
||||
import {
|
||||
type BeerEntry,
|
||||
resolveBeer,
|
||||
getAllBeers,
|
||||
searchBeers,
|
||||
getBeerByKegId,
|
||||
getBreweryLogo,
|
||||
getCustomFallback,
|
||||
} from "./beer-catalog.js";
|
||||
import "./editor.js";
|
||||
|
||||
const CARD_VERSION = "0.2.0";
|
||||
const CARD_VERSION = "0.3.1";
|
||||
|
||||
const NO_KEG_LABEL = "No keg detected";
|
||||
|
||||
/** Stand-in used when nothing is tapped, so the card never names a beer it has not detected. */
|
||||
function noKegPlaceholder(): BeerEntry {
|
||||
return { ...getCustomFallback(), slug: "no-keg", name: NO_KEG_LABEL };
|
||||
}
|
||||
|
||||
interface RenderCtx {
|
||||
beer: BeerEntry;
|
||||
@@ -57,17 +64,16 @@ function parseNumericState(stateStr: string | undefined): number | null {
|
||||
export class PerfectDraftCard extends LitElement {
|
||||
@property({ attribute: false }) public hass: any;
|
||||
@state() private _config!: PerfectDraftCardConfig;
|
||||
@state() private _beer!: BeerEntry;
|
||||
@state() private _beer?: BeerEntry;
|
||||
@state() private _glassSize = DEFAULT_GLASS_SIZE;
|
||||
@state() private _layout: CardLayout = DEFAULT_LAYOUT as CardLayout;
|
||||
@state() private _matrixColumns?: number;
|
||||
@state() private _maxMatrixWidth?: string;
|
||||
@state() private _showGlassDialog = false;
|
||||
@state() private _showBeerDialog = false;
|
||||
@state() private _beerSearchQuery = "";
|
||||
@state() private _failedImages = new Set<string>();
|
||||
|
||||
private _entityIds: { temperature?: string; kegRemaining?: string; kegFreshness?: string } = {};
|
||||
private _entityIds: { temperature?: string; kegRemaining?: string; kegFreshness?: string; kegProduct?: string; kegName?: string } = {};
|
||||
private _entitiesResolved = false;
|
||||
|
||||
public setConfig(config: PerfectDraftCardConfig): void {
|
||||
if (!config.device_id) {
|
||||
@@ -75,6 +81,16 @@ export class PerfectDraftCard extends LitElement {
|
||||
"PerfectDraft Card: No device configured. Please use the visual editor to select a PerfectDraft device.",
|
||||
);
|
||||
}
|
||||
|
||||
// Entity IDs and the detected beer belong to a specific device, so switching
|
||||
// devices in the editor has to invalidate them. Without this the card keeps
|
||||
// reading the previous device's sensors.
|
||||
if (this._config?.device_id !== config.device_id) {
|
||||
this._entityIds = {};
|
||||
this._entitiesResolved = false;
|
||||
this._beer = undefined;
|
||||
}
|
||||
|
||||
this._config = { ...config };
|
||||
|
||||
this._layout = resolveLayout(config.layout) as CardLayout;
|
||||
@@ -90,10 +106,6 @@ export class PerfectDraftCard extends LitElement {
|
||||
|
||||
const savedGlass = localStorage.getItem(storageKey(config.device_id, "glass"));
|
||||
this._glassSize = savedGlass ? parseInt(savedGlass, 10) : (config.glass_size ?? DEFAULT_GLASS_SIZE);
|
||||
|
||||
const savedBeer = localStorage.getItem(storageKey(config.device_id, "beer"));
|
||||
const beerName = savedBeer ?? config.beer_name;
|
||||
this._beer = resolveBeer(beerName, config.custom_beers);
|
||||
}
|
||||
|
||||
public getCardSize(): number {
|
||||
@@ -133,7 +145,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
}
|
||||
}
|
||||
const firstDevice = deviceIds.size === 1 ? [...deviceIds][0] : "";
|
||||
return { device_id: firstDevice, beer_name: "Stella Artois", glass_size: DEFAULT_GLASS_SIZE, layout: DEFAULT_LAYOUT };
|
||||
return { device_id: firstDevice, glass_size: DEFAULT_GLASS_SIZE, layout: DEFAULT_LAYOUT };
|
||||
}
|
||||
|
||||
public static getConfigElement(): HTMLElement {
|
||||
@@ -145,17 +157,20 @@ export class PerfectDraftCard extends LitElement {
|
||||
this._resolveEntities();
|
||||
}
|
||||
|
||||
updated(changedProps: Map<string, unknown>): void {
|
||||
super.updated(changedProps);
|
||||
if (changedProps.has("hass")) {
|
||||
protected willUpdate(changedProps: PropertyValues): void {
|
||||
if (changedProps.has("hass") || changedProps.has("_config")) {
|
||||
this._resolveEntities();
|
||||
this._updateDetectedBeer();
|
||||
}
|
||||
}
|
||||
|
||||
private _resolveEntities(): void {
|
||||
if (!this.hass || !this._config?.device_id) return;
|
||||
|
||||
if (this._entityIds.temperature) return;
|
||||
// Keep scanning until the expected set is complete. Stopping as soon as any
|
||||
// one entity is found would strand a card whose keg sensors only appear
|
||||
// later, e.g. after the user updates the integration.
|
||||
if (this._entitiesResolved) return;
|
||||
|
||||
const entityReg: Record<string, any> = this.hass.entities || {};
|
||||
|
||||
@@ -169,8 +184,73 @@ export class PerfectDraftCard extends LitElement {
|
||||
this._entityIds.kegRemaining = entityId;
|
||||
} else if (key === "keg_freshness") {
|
||||
this._entityIds.kegFreshness = entityId;
|
||||
} else if (key === "keg_product_id") {
|
||||
this._entityIds.kegProduct = entityId;
|
||||
} else if (key === "keg_name") {
|
||||
this._entityIds.kegName = entityId;
|
||||
}
|
||||
}
|
||||
|
||||
this._entitiesResolved = Boolean(
|
||||
this._entityIds.temperature &&
|
||||
this._entityIds.kegRemaining &&
|
||||
this._entityIds.kegFreshness &&
|
||||
this._entityIds.kegProduct &&
|
||||
this._entityIds.kegName,
|
||||
);
|
||||
}
|
||||
|
||||
/** True when the device is present but predates the integration release that added the keg sensors. */
|
||||
private get _kegSensorsMissing(): boolean {
|
||||
return (
|
||||
Boolean(this._entityIds.temperature) &&
|
||||
!this._entityIds.kegProduct &&
|
||||
!this._entityIds.kegName
|
||||
);
|
||||
}
|
||||
|
||||
private get _beerDetected(): boolean {
|
||||
return this._beer !== undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the beer to display, in precedence order: the manual override, then
|
||||
* a catalog entry matched on the reported product ID, then the reported keg
|
||||
* name. Leaves `_beer` undefined when none of those yield anything, which is
|
||||
* what puts the card into its no-keg state.
|
||||
*/
|
||||
private _updateDetectedBeer(): void {
|
||||
if (!this._config) return;
|
||||
|
||||
const override = this._config.beer_name?.trim();
|
||||
if (override) {
|
||||
this._assignBeer(resolveBeer(override, this._config.custom_beers));
|
||||
return;
|
||||
}
|
||||
|
||||
const idState = this._getState(this._entityIds.kegProduct);
|
||||
const nameState = this._getState(this._entityIds.kegName);
|
||||
const reportedName =
|
||||
nameState && nameState !== "unavailable" && nameState !== "unknown" ? nameState : undefined;
|
||||
|
||||
let detected: BeerEntry | undefined;
|
||||
if (idState && /^\d+$/.test(idState)) {
|
||||
// A recognised product ID keeps the curated catalog name. The integration's
|
||||
// catalog is a product listing, so its names carry pack sizes and
|
||||
// qualifiers we do not want on the label.
|
||||
detected = getBeerByKegId(idState);
|
||||
}
|
||||
if (!detected && reportedName) {
|
||||
detected = resolveBeer(reportedName, this._config.custom_beers);
|
||||
}
|
||||
|
||||
this._assignBeer(detected);
|
||||
}
|
||||
|
||||
private _assignBeer(beer: BeerEntry | undefined): void {
|
||||
if (beer?.slug !== this._beer?.slug || beer?.name !== this._beer?.name) {
|
||||
this._beer = beer;
|
||||
}
|
||||
}
|
||||
|
||||
private _getState(entityId: string | undefined): string | undefined {
|
||||
@@ -186,23 +266,10 @@ export class PerfectDraftCard extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private _selectBeer(beer: BeerEntry): void {
|
||||
this._beer = beer;
|
||||
this._showBeerDialog = false;
|
||||
this._beerSearchQuery = "";
|
||||
if (this._config?.device_id) {
|
||||
localStorage.setItem(storageKey(this._config.device_id, "beer"), beer.name);
|
||||
}
|
||||
}
|
||||
|
||||
private _imgError(src: string): void {
|
||||
this._failedImages = new Set(this._failedImages).add(src);
|
||||
}
|
||||
|
||||
private _openBeerDialog = (): void => {
|
||||
this._showBeerDialog = true;
|
||||
};
|
||||
|
||||
private _openGlassDialog = (): void => {
|
||||
this._showGlassDialog = true;
|
||||
};
|
||||
@@ -216,15 +283,8 @@ export class PerfectDraftCard extends LitElement {
|
||||
return html`<ha-card><div class="error">No device configured. Please edit this card to select a PerfectDraft device.</div></ha-card>`;
|
||||
}
|
||||
|
||||
// Check beer_entity override
|
||||
if (this._config.beer_entity) {
|
||||
const entityState = this._getState(this._config.beer_entity);
|
||||
if (entityState && entityState !== "unavailable" && entityState !== "unknown") {
|
||||
const resolved = resolveBeer(entityState, this._config.custom_beers);
|
||||
if (resolved.slug !== this._beer?.slug) {
|
||||
this._beer = resolved;
|
||||
}
|
||||
}
|
||||
if (this._kegSensorsMissing) {
|
||||
return html`<ha-card><div class="error">This card needs the keg sensors added in PerfectDraft integration 0.4.0. Please update the integration, then reload this page.</div></ha-card>`;
|
||||
}
|
||||
|
||||
const temp = parseNumericState(this._getState(this._entityIds.temperature));
|
||||
@@ -235,7 +295,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
const volumeMl = kegPct !== null ? (kegPct / 100) * KEG_TOTAL_VOLUME_ML : null;
|
||||
const glassCount = volumeMl !== null ? Math.floor(volumeMl / this._glassSize) : null;
|
||||
|
||||
const beer = this._beer ?? resolveBeer(undefined);
|
||||
const beer = this._beer ?? noKegPlaceholder();
|
||||
const ctx: RenderCtx = { beer, temp, kegPct, freshDays, tier, glassCount };
|
||||
|
||||
const body =
|
||||
@@ -253,7 +313,6 @@ export class PerfectDraftCard extends LitElement {
|
||||
<ha-card class="tier-${tier} layout-${this._layout}">
|
||||
${body}
|
||||
${this._showGlassDialog ? this._renderGlassDialog() : nothing}
|
||||
${this._showBeerDialog ? this._renderBeerDialog() : nothing}
|
||||
</ha-card>
|
||||
`;
|
||||
}
|
||||
@@ -272,6 +331,10 @@ export class PerfectDraftCard extends LitElement {
|
||||
|
||||
/** Tiered visual: keg photo -> brewery logo -> generated tinted silhouette. */
|
||||
private _renderVisual(beer: BeerEntry): TemplateResult {
|
||||
// Nothing tapped means no product to picture, so skip straight to the
|
||||
// neutral silhouette rather than the photo and logo tiers.
|
||||
if (!this._beerDetected) return this._renderKegSilhouette(beer);
|
||||
|
||||
const kegSrc = beer.imagePath
|
||||
? beer.imagePath.startsWith("http")
|
||||
? beer.imagePath
|
||||
@@ -296,7 +359,8 @@ export class PerfectDraftCard extends LitElement {
|
||||
|
||||
/** Generated, asset-free keg silhouette tinted from the beer palette, with its initial. */
|
||||
private _renderKegSilhouette(beer: BeerEntry): TemplateResult {
|
||||
const initial = (beer.name.charAt(0) || "?").toUpperCase();
|
||||
// No initial in the no-keg state: a letter would read as a beer's identity.
|
||||
const initial = this._beerDetected ? (beer.name.charAt(0) || "?").toUpperCase() : "";
|
||||
const { primary, secondary } = beer.colors;
|
||||
return html`
|
||||
<svg class="gen-svg" viewBox="0 0 120 150" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${beer.name}">
|
||||
@@ -340,7 +404,9 @@ export class PerfectDraftCard extends LitElement {
|
||||
<div class="beer-logo-area">${this._renderVisual(beer)}</div>
|
||||
<div class="temperature" style="color: ${beer.colors.text};">❄ ${this._tempText(temp)}</div>
|
||||
<div class="beer-name" style="color: ${beer.colors.text};">${beer.name}</div>
|
||||
<div class="beer-style" style="color: ${beer.colors.text}88;">${beer.brewery} · ${beer.abv}%</div>
|
||||
${this._beerDetected
|
||||
? html`<div class="beer-style" style="color: ${beer.colors.text}88;">${beer.brewery} · ${beer.abv}%</div>`
|
||||
: nothing}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -359,7 +425,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
private _renderLandscape(c: RenderCtx): TemplateResult {
|
||||
return html`
|
||||
<div class="card-content layout-landscape-content">
|
||||
<div class="label-zone" @click=${this._openBeerDialog} style="${this._labelStyle(c.beer)}">
|
||||
<div class="label-zone" style="${this._labelStyle(c.beer)}">
|
||||
${this._renderLabelInner(c.beer, c.temp)}
|
||||
</div>
|
||||
<div class="keg-zone" @click=${this._openGlassDialog}>${this._renderKegContent(c)}</div>
|
||||
@@ -370,7 +436,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
private _renderPortrait(c: RenderCtx): TemplateResult {
|
||||
return html`
|
||||
<div class="card-content layout-portrait-content">
|
||||
<div class="label-zone label-zone-top" @click=${this._openBeerDialog} style="${this._labelStyle(c.beer)}">
|
||||
<div class="label-zone label-zone-top" style="${this._labelStyle(c.beer)}">
|
||||
${this._renderLabelInner(c.beer, c.temp)}
|
||||
</div>
|
||||
<div class="keg-zone" @click=${this._openGlassDialog}>${this._renderKegContent(c)}</div>
|
||||
@@ -382,8 +448,8 @@ export class PerfectDraftCard extends LitElement {
|
||||
const pct = c.kegPct ?? 0;
|
||||
return html`
|
||||
<div class="card-content layout-compact-content">
|
||||
<div class="compact-visual" @click=${this._openBeerDialog}>${this._renderVisual(c.beer)}</div>
|
||||
<div class="compact-main" @click=${this._openBeerDialog}>
|
||||
<div class="compact-visual">${this._renderVisual(c.beer)}</div>
|
||||
<div class="compact-main">
|
||||
<div class="compact-name">${c.beer.name}</div>
|
||||
<div class="compact-bar">
|
||||
<div class="compact-bar-fill" style="width: ${pct}%; background: ${c.beer.colors.primary};"></div>
|
||||
@@ -401,7 +467,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
return html`
|
||||
<div class="card-content layout-hero-content"
|
||||
style="background: radial-gradient(circle at 50% 38%, ${c.beer.colors.primary}33, ${c.beer.colors.primary}0d);">
|
||||
<div class="hero-visual" @click=${this._openBeerDialog}>${this._renderVisual(c.beer)}</div>
|
||||
<div class="hero-visual">${this._renderVisual(c.beer)}</div>
|
||||
<div class="hero-scrim" @click=${this._openGlassDialog}>
|
||||
<div class="hero-line">
|
||||
<span class="hero-name">${c.beer.name}</span>
|
||||
@@ -418,7 +484,7 @@ export class PerfectDraftCard extends LitElement {
|
||||
const pct = c.kegPct ?? 0;
|
||||
return html`
|
||||
<div class="card-content layout-vessel-content">
|
||||
<div class="vessel-top" @click=${this._openBeerDialog}>
|
||||
<div class="vessel-top">
|
||||
<span class="vessel-name">${c.beer.name}</span>
|
||||
<span class="vessel-temp">❄ ${this._tempText(c.temp)}</span>
|
||||
</div>
|
||||
@@ -497,61 +563,6 @@ export class PerfectDraftCard extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private _renderBeerDialog(): TemplateResult {
|
||||
const beers = this._beerSearchQuery
|
||||
? searchBeers(this._beerSearchQuery)
|
||||
: getAllBeers();
|
||||
|
||||
const customBeers = (this._config.custom_beers ?? []).filter(
|
||||
(cb) =>
|
||||
!this._beerSearchQuery ||
|
||||
cb.name.toLowerCase().includes(this._beerSearchQuery.toLowerCase()),
|
||||
);
|
||||
|
||||
return html`
|
||||
<div class="dialog-overlay" @click=${() => { this._showBeerDialog = false; this._beerSearchQuery = ""; }}>
|
||||
<div class="dialog beer-dialog" @click=${(e: Event) => e.stopPropagation()}>
|
||||
<div class="dialog-title">Select Beer</div>
|
||||
<input
|
||||
class="beer-search"
|
||||
type="text"
|
||||
placeholder="Search beers..."
|
||||
.value=${this._beerSearchQuery}
|
||||
@input=${(e: InputEvent) => { this._beerSearchQuery = (e.target as HTMLInputElement).value; }}
|
||||
/>
|
||||
<div class="beer-list">
|
||||
${beers.map(
|
||||
(b) => html`
|
||||
<div class="dialog-option beer-option ${b.slug === this._beer?.slug ? "selected" : ""}"
|
||||
@click=${() => this._selectBeer(b)}>
|
||||
<span class="beer-color-dot" style="background: ${b.colors.primary};"></span>
|
||||
<span class="option-label">${b.name}</span>
|
||||
<span class="option-desc">${b.brewery} · ${b.abv}%</span>
|
||||
</div>
|
||||
`,
|
||||
)}
|
||||
${customBeers.length > 0
|
||||
? html`
|
||||
<div class="custom-heading">Custom</div>
|
||||
${customBeers.map(
|
||||
(cb) => html`
|
||||
<div class="dialog-option beer-option"
|
||||
@click=${() => this._selectBeer(resolveBeer(cb.name, this._config.custom_beers))}>
|
||||
<span class="beer-color-dot" style="background: ${cb.color_primary ?? "#555"};"></span>
|
||||
<span class="option-label">${cb.name}</span>
|
||||
<span class="option-desc">${cb.brewery ?? "Custom"}</span>
|
||||
</div>
|
||||
`,
|
||||
)}
|
||||
`
|
||||
: nothing
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
return css`
|
||||
:host {
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@ export type CardLayout = "landscape" | "portrait" | "compact" | "hero" | "vessel
|
||||
export interface PerfectDraftCardConfig {
|
||||
type?: string;
|
||||
device_id: string;
|
||||
beer_name?: string;
|
||||
glass_size?: number;
|
||||
beer_entity?: string;
|
||||
/** Overrides auto-detection. Left unset, the tapped beer is read from the integration. */
|
||||
beer_name?: string;
|
||||
custom_beers?: CustomBeerEntry[];
|
||||
layout?: CardLayout;
|
||||
matrix_columns?: number | "auto";
|
||||
|
||||
Reference in New Issue
Block a user