cremalink.ecam.settings module

Writable machine settings — 0x95 reads and 0x90 writes.

Four 0x95 answer shapes were observed on Soul LAN (§3):

  • short stored-value blob: 95 0f <param:2B> <u32> (the republished dNNN backing property, e.g. d282_mchn_sett_aoff);

  • full republish: 95 f0 <param:2B> <u32> <descriptor tail…>;

  • ack echo: 95 f0 <param:2B> (2-byte payload, no value);

  • unknown parameter: 36 zero bytes (no entry produced).

The APK q0() list parser (count=(len-7)/4 consecutive u32s from start=u16@[4,5]) covers the value-bearing shapes uniformly.

class cremalink.ecam.settings.BitSetting(key: str, param_id: int, mask: int, capability: str, datapoint_hint: str = '', inverted: bool = False)[source]

Bases: object

A boolean flag inside a shared parameter word (0x90 write).

inverted=True means the set bit carries the OFF semantics (the APK’s Parameter.f() autostart: bit set = autostart disabled).

capability: str
datapoint_hint: str = ''
inverted: bool = False
key: str
mask: int
param_id: int
cremalink.ecam.settings.SETTING_BIT_MAPS: dict[str, BitSetting] = {'autostart': BitSetting(key='autostart', param_id=63, mask=1, capability='auto_start_settings', datapoint_hint='user_conf', inverted=True), 'beep': BitSetting(key='beep', param_id=63, mask=4, capability='buzzer_settings', datapoint_hint='user_conf', inverted=False), 'cup_light': BitSetting(key='cup_light', param_id=63, mask=8, capability='cup_light_settings', datapoint_hint='user_conf', inverted=False), 'cup_warmer': BitSetting(key='cup_warmer', param_id=63, mask=32, capability='cup_warmer_settings', datapoint_hint='user_conf', inverted=False), 'energy_saving': BitSetting(key='energy_saving', param_id=63, mask=16, capability='energy_saving_settings', datapoint_hint='user_conf', inverted=False)}

Param 0x003F (d284_mchn_sett_user_conf) bits — decoded from the APK’s it/delonghi/ecam/model/Parameter.java (protocol.md §14.8): f() autostart 0x01 (inverted), g() beep 0x04, h() cup light 0x08, j() energy saving 0x10, i() cup warmer 0x20. Live value 0x1D = beep+energy ON.

cremalink.ecam.settings.SETTING_OPTION_MAPS: dict[str, WritableSetting] = {'auto_off': WritableSetting(key='auto_off', param_id=62, options={0: '15 min', 1: '30 min', 2: '1 h', 3: '3 h'}, capability='auto_off_settings', datapoint_hint='off', default_levels=None), 'temperature': WritableSetting(key='temperature', param_id=61, options={0: 'low', 1: 'medium', 2: 'high', 3: 'max'}, capability='globalTemperature', datapoint_hint='_temp', default_levels=3), 'water_hardness': WritableSetting(key='water_hardness', param_id=50, options={0: 'level_1', 1: 'level_2', 2: 'level_3', 3: 'level_4'}, capability='water_hardness_settings', datapoint_hint='water', default_levels=None)}

Option maps (auto-off labels from the machine display; water hardness stores a 0-based index, displayed level = raw+1; coffee temperature levels as the app names them, the first three checked on the machine).

class cremalink.ecam.settings.WritableSetting(key: str, param_id: int, options: dict[int, str], capability: str, datapoint_hint: str = '', default_levels: int | None = None)[source]

Bases: object

A capability-gated machine setting writable via 0x90.

capability: str
datapoint_hint: str = ''
default_levels: int | None = None

Levels a model offers unless its map’s setting_levels says otherwise (None: every option).

key: str
options: dict[int, str]
param_id: int
cremalink.ecam.settings.merge_setting_bit(param_raw: int, setting: BitSetting, on: bool) → int[source]

Return param_raw with setting’s flag set to on.

on is the logical state (autostart on=True clears its inverted bit); every unrelated bit is preserved — the merged u32 is what goes on the wire in the 0x90 write.

cremalink.ecam.settings.parse_settings(blob: bytes | bytearray) → dict[int, int][source]

Parse a 0x95 answer/stored blob into {param_id: raw_u32}.

Shape-tolerant: short stored values, full republish blobs (descriptor tail ignored), ack echoes (no values) and all-zero unknown-parameter blobs are all handled without raising.

cremalink.ecam.settings.settings_bits(param_id: int, param_raw: int) → dict[str, bool][source]

Decode a param word into {key: on/off} for its bit settings.

Only settings backed by param_id are decoded — inversion-aware (autostart’s set bit means OFF).