Skip to content

v3: integer config param is not coerced to int (source receives a float) #6941

Description

@markvp

Found while reviewing the release/3.0.0 branch. Severity: medium. Verified.

The integer widget renders NumberSelector(NumberSelectorConfig(mode=BOX, step=1)) with no vol.Coerce(int) (config_flow.py ~287), so it yields a float. A source using config_params.integer("count") receives count=5.0 and stores it, which breaks range(count), slicing, and similar. Compare CONF_COUNT in get_sensor_schema, which wraps vol.All(vol.Coerce(int), vol.Range(min=1)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0.0 feedbackFeedback from trialling the v3 (3.0.0) beta

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions