cremalink.ecam.params module
Recipe-parameter metadata shared by the brew-with-overrides paths.
The machine models every tunable recipe parameter as a numeric value
bounded by a per-recipe <param><min><def><max> triple (the 0xB0
descriptor; protocol.md §14.3). This module is the single source of truth
for which of those parameters are user-adjustable controls and how raw
wire units map to display units — the scaling mirrors the app’s
RecipeData getters (m()/siblings; research.md R11): coffee/water
raw = ml directly (the 0xB0 defValue is returned unscaled
when the ingredients list exists — the ×0.5 halfMlToMl path is only
the legacy no-ingredients fallback), milk raw = tenths of a second.
Pure data/helpers: no I/O, no Home Assistant imports.
- cremalink.ecam.params.BEAN_SYSTEM_ID_MIN = 200
Bean-system (BeanAdapt) beverage-id range —
m6.aenum, matchescatalog.BEAN_SYSTEM_IDS(kept here so builder/device/catalog can share one definition without circular imports).
- cremalink.ecam.params.MANAGEMENT_PARAMS = frozenset({27, 28})
Recipe-management tags that ride the wire at stored values but are never user controls.
24/25/30fail theE0predicate anyway,8is dropped by the app’sO()builder itself, and27/28are the INDEX_LENGTH/ACCESSORIO descriptor fields.
- cremalink.ecam.params.PARAMS: dict[int, ParamMeta] = {1: ParamMeta(param_id=1, key='coffee', unit='ml', to_display=1.0, step_raw=1, adjustable=True), 2: ParamMeta(param_id=2, key='taste', unit=None, to_display=1.0, step_raw=1, adjustable=True), 9: ParamMeta(param_id=9, key='milk', unit='s', to_display=0.1, step_raw=10, adjustable=True), 13: ParamMeta(param_id=13, key='the_temp', unit=None, to_display=1.0, step_raw=1, adjustable=True), 15: ParamMeta(param_id=15, key='water', unit='ml', to_display=1.0, step_raw=1, adjustable=True)}
User-adjustable recipe parameters — the controls the app’s brew sheet actually offers (
MainBeveragesFragment.E1()→V0/U0/Y0/c1/b1; research.md R12). On a product-coded machine (EcamMachine.N()— every Wi-Fi family incl. the Soul) those are coffee amount, aroma, milk amount and hot-water amount plus the tea-temperature picker, which exists only for recipes carrying theTHE_TEMP(13)ingredient (Soul: tea only). BeanAdapt (id0xC8) gets the coffee-amount control alone.Not controls on these machines, so no entity here:
TEMP(0)— theb1temp picker looks for id 13 onN()machines (and for id 0 only on machines without a product code);BLEND(4)andMILK_FROTH(11)— only in the!N()branch (and blend additionally needsnGrinders > 1; Soul: 0);INVERSION(12)— a stored recipe flag selectingPREPARE_BEVERAGE_INVERSION(RecipeData.T()inn0()/brew dispatch), set at recipe creation, never a slider; tag27is INDEX_LENGTH (management — rides the wire at its stored value viaE0; the earlier “temperature” guess came fromcatalog.TAG_NAMES, superseded — R11).
- class cremalink.ecam.params.ParamMeta(param_id: int, key: str, unit: str | None, to_display: float, step_raw: int, adjustable: bool = True)[source]
Bases:
objectDisplay metadata for one user-adjustable recipe parameter id.
to_displayconverts a raw wire value to display units;step_rawis the raw-step equivalent of one display step (coffee/water: 1 raw = 1 ml; milk: 10 raw = 1 s).
- cremalink.ecam.params.TAG_COFFEE = 1
0xB0tag carrying the coffee amount (m6.i.COFFEE).
- cremalink.ecam.params.TAG_MILK = 9
0xB0tag carrying the milk amount (m6.i.MILK).
- cremalink.ecam.params.TAG_TASTE = 2
0xB0tag carrying the intensity/aroma level.
- cremalink.ecam.params.TAG_WATER = 15
0xB0tag carrying the hot-water amount (m6.i.HOT_WATER).
- cremalink.ecam.params.adjustable_params(bounds: Mapping[int, tuple[int, int, int]], values: Mapping[int, int] | None = None, beverage_id: int | None = None) dict[int, ParamMeta][source]
Adjustable
ParamMetasubset for a recipe.Mirrors the app’s brew-sheet builder
MainBeveragesFragment.E1()for a product-coded machine (EcamMachine.N()— research.md R12): a control exists when its ingredient is in the recipe (pid in bounds) and — for the quantity controls — the stored amount is positive (k() > 0/u() > 0/C() > 0, hiding unconfigured recipes like Mug To-Go and empty custom slots whose amount is 0). Aroma additionally needs a positive coffee amount (U0). BeanAdapt (id0xC8) gets the coffee-amount control alone — the app’sid == 200special case — because its other fields are configured in the BeanAdapt flow, not at brew time.valuesare the recipe’s current amounts (profile read); the descriptor default is used for a missing entry.min < maxstill gates every control — a slider needs a real range.
- cremalink.ecam.params.is_bean_beverage(beverage_id: int) bool[source]
True for BeanAdapt beverages — they brew with
action | 0x80.