feat!: audit and complete Zeo protocol DP and enum mappings#892
feat!: audit and complete Zeo protocol DP and enum mappings#892NOisi-x wants to merge 2 commits into
Conversation
13614b7 to
7763c0e
Compare
… all 56 devices covered Expand RoborockZeoProtocol from 31 to 67 DP entries, ordered by numeric ID. Add all missing enum classes (ZeoFeatureBits, ZeoDryingMethod, ZeoSteamVolume, ZeoDryAndCare, ZeoDryerStartError) and extend existing enums to cover every state/value found in the official app plugin bundle. Add ZeoStartParams, ZeoCustomMode, and ZeoDryerCustomMode data containers inheriting from RoborockBase, placed in zeo_containers.py per reviewer guidance.
| included when the device reports a non-None value. | ||
| """ | ||
|
|
||
| mode: int |
There was a problem hiding this comment.
is this ZeoMode? If you can also change here and below that would be great
| mode: int | ||
| """Wash mode (e.g. wash, wash-and-dry, dry, treatment).""" | ||
|
|
||
| program: int |
| spin_level: int | None = None | ||
| """Spin speed in RPM (always ``None`` for dryers).""" | ||
|
|
||
| drying_mode: int | None = None |
There was a problem hiding this comment.
This can be ZeoDryingMode
There was a problem hiding this comment.
All done — hope I didn't misunderstand what you meant.
Update ZeoStartParams, ZeoCustomMode, and ZeoDryerCustomMode to use typed enum fields (ZeoMode, ZeoProgram, ZeoTemperature, etc.) instead of raw int, aligning with the V1 container pattern in v1_containers.py. Rename shorthand fields (rinse_times→rinse, spin_level→spin) for consistency across all three classes. Unify drying-mode field naming.
| @@ -1,142 +1,320 @@ | |||
| """Zeo (washing machine) device enums. | |||
There was a problem hiding this comment.
I think some of these comments can be removed or shortened as they are more of a response from the agent than a comment on the code, does that make sense?
There was a problem hiding this comment.
Referencing the bundle isn't needed because the files will change a lot. I.e. no need to say module 706
| class ZeoProgram(RoborockEnum): | ||
| null = 0 | ||
| standard = 1 | ||
| null = 0 # (not found in app bundle) |
There was a problem hiding this comment.
No need to say not found in bundle here
| dryer_network_fail = 7 # Please check the dryer network connection. | ||
|
|
||
|
|
||
| # The following are App-internal lookup tables extracted from the bundle. |
There was a problem hiding this comment.
Let's remove this commented out code
| """Dry-care mode (bits 25-27).""" | ||
|
|
||
| steam_volume: ZeoSteamVolume | ||
| """Steam volume (bits 28-30).""" |
| """Total programme time in minutes (from DP 239).""" | ||
|
|
||
| @classmethod | ||
| def from_raw(cls, raw: int, total_time_min: int | None = None) -> "ZeoCustomMode": |
There was a problem hiding this comment.
Let's use the typing.Self here if possible, not a big fan of forward references
| """Total programme time in minutes (from DP 239).""" | ||
|
|
||
| @classmethod | ||
| def from_raw(cls, raw: int, total_time_min: int | None = None) -> "ZeoDryerCustomMode": |
Summary
Complete a full audit of the
RoborockZeoProtocolDP enum against the official Roborock Washer app plugin bundle, expanding coverage from 31 to 67 entries and adding all missing enum mappings. Every known Zeo device feature is now represented in the protocol definition.These findings build upon the excellent reverse engineering work done in ndwzy/roborock_washer_ha.
What was done
A systematic cross-reference was performed between the existing
RoborockZeoProtocolenum and the React Native plugin bundle index.ios.bundle extracted from the official Roborock Washer app. Every DP ID, value mapping, and access mode (ro/rw/wo) was verified against the source of truth.RoborockZeoProtocol— 31 → 67 DP entriesReorganized into five semantic sections matching the app's internal structure:
Newly identified entries (previously undefined):
DIRT_DETECTION_STATUS,DIRT_DETECTION_SWITCH,UV_LIGHT,SOAK,SMART_HOSTING,SMART_HOSTING_TIME,SMART_HOSTING_WAITED_TIME,FEATURE_BITS,CUSTOM_PROGRAM_CLEANING_TIME,SILENT_MODE_ON,SILENT_MODE_START_TIME,SILENT_MODE_END_TIME,DRY_CARE_MODE,SOFTENER_EXPANSION_TYPE,SMILE_LIGHT_STATUS,DETERGENT_EXPANSION_TYPE,FLUFF_CLEANED,IS_NEED_FLUFF_CLEAN,POWER_LIGHT,PANEL_PROGRAM_PARAMS_SET,PANEL_PROGRAM_PARAMS_SET_RESULT,PANEL_TIMING_PROGRAM_PARAMS,SAVE_ADAPTED_CLOUD_PROGRAM,WASH_DRY_LINKED,DRYING_METHOD,STEAM_VOLUME,ION_DEODORIZATION,STEAM_CARE_TIME,DEVICE_BOUND,CLOTH_PUT_IN,CLOTH_READY_TO_DRY_COUNT_DOWN,START_DRYER_ERROR,WIFI_LINKAGE_RESET,SET_SOUND_PACKAGE,VOICE_VOLUME,VOICE_SWITCH,VOICE_RECORD_INFO,VOICE_RECORD,VOICE_RECORD_DELETEEnum mappings — all missing enums added
ZeoFeatureBits(NEW)ZeoModetreatment = 4ZeoStateupdating,steam_caring,descaling,cloth_ready,waiting_for_drying,pre_heating,pre_heat_complete,in_careZeoProgramZeoErrorZeoDryingMethod(NEW)ZeoSteamVolume(NEW)ZeoDryAndCare(NEW)ZeoDryerStartError(NEW)Data containers — placed per reviewer guidance
ZeoStartParamszeo_containers.pyZeoCustomModezeo_containers.pyZeoDryerCustomModezeo_containers.pyAll three inherit from
RoborockBase, following the project convention established byDyadProductInfoand other containers. Placed inroborock/data/zeo/zeo_containers.pyto keep the traits module maintainable.Breaking changes
RoborockZeoProtocolrenamed two enum members for consistency withRoborockMessageProtocol:RPC_REQ→RPC_REQUESTRPC_RESp→RPC_RESPONSEA grep of the current
mainbranch confirms zero references to the old names — no code or test is affected.Device coverage
🧺 Washers — 52 models
👕 Dryers — 4 models
Reviewer notes
Addresses the following feedback from #871:
RoborockBasezeo_containers.pyinstead of the traits filePart of: #871