Skip to content

Add status fields to StatusField enum #874

Description

@allenporter

Feature Request: Add status fields to StatusField enum

Background

In the Home Assistant integration for Roborock, we currently check device capabilities for several status-derived sensors using various custom properties, traits, or check functions (e.g., checking if wash_towel_mode or is_support_water_mode is enabled).

To make these capability checks clean and uniform, we propose adding the corresponding fields from StatusV2 to the StatusField enum, allowing them to be checked directly using api.device_features.is_field_supported(StatusV2, StatusField.FIELD_NAME).

Proposed StatusField Additions

We would like to add the following fields (defined in StatusV2) to the StatusField enum in roborock/data/v1/v1_containers.py:

StatusField Candidate StatusV2 Dataclass Field Current check proxy in Home Assistant
WATER_BOX_CARRIAGE_STATUS water_box_carriage_status api.device_features.is_support_water_mode
WATER_BOX_STATUS water_box_status api.device_features.is_support_water_mode
WATER_SHORTAGE_STATUS water_shortage_status api.device_features.is_support_water_mode
DIRTY_WATER_BOX_STATUS dirty_water_box_status api.wash_towel_mode is not None
CLEAR_WATER_BOX_STATUS clear_water_box_status api.wash_towel_mode is not None
CLEAN_FLUID_STATUS clean_fluid_status api.wash_towel_mode is not None & api.device_features.is_clean_fluid_delivery_supported
CLEAN_PERCENT clean_percent api.device_features.is_support_clean_estimate
DOCK_ERROR_STATUS dock_error_status api.dust_collection_mode is not None
RDT / DRYING_TIME_REMAINING rdt api.device_features.is_supported_drying

By adding these fields to the enum and mapping them to their corresponding device features, dps protocols, IDs, or other internal checks, we can simplify entity registration and capability checking across the Home Assistant integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions