Repository: home-assistant/core
File: homeassistant/components/matter/number.py (Python)

Code before:
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="TemperatureOffset",
            device_class=NumberDeviceClass.TEMPERATURE,
            entity_category=EntityCategory.CONFIG,
            translation_key="temperature_offset",
            native_max_value=25,  # Matter 1.3 limit
            native_min_value=-25,  # Matter 1.3 limit
            native_step=0.5,
            native_unit_of_measurement=UnitOfTemperature.CELSIUS,
            device_to_ha=lambda x: None if x is None else x / 10,
            ha_to_device=lambda x: round(x * 10),
            mode=NumberMode.BOX,
        ),
        entity_class=MatterNumber,
        required_attributes=(
            clusters.Thermostat.Attributes.LocalTemperatureCalibration,
        ),
    ),
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="pump_setpoint",
            native_unit_of_measurement=PERCENTAGE,
            translation_key="pump_setpoint",
            native_max_value=100,
            native_min_value=0.5,
            native_step=0.5,
            device_to_ha=(
                lambda x: None
                if x is None
                else min(x, 200) / 2  # Matter range (1-200, capped at 200)
            ),
            ha_to_device=lambda x: round(x * 2),  # HA range 0.5–100.0%
            mode=NumberMode.SLIDER,
        ),
        entity_class=MatterLevelControlNumber,
        required_attributes=(clusters.LevelControl.Attributes.CurrentLevel,),
        device_type=(device_types.Pump,),
        allow_multi=True,
    ),
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="PIROccupiedToUnoccupiedDelay",
            entity_category=EntityCategory.CONFIG,
            translation_key="hold_time",  # pir_occupied_to_unoccupied_delay for old revisions
            native_max_value=65534,
            native_min_value=0,
            native_unit_of_measurement=UnitOfTime.SECONDS,

Review comment (suggestion):
This breaks old entities, since we change the unique ID here.

(The `key` is used as part of the unique ID, so Home Assistant knows what entity we provide here. We cannot change that for existing entities, as the old one will no longer be provided then, with a new one appearing instead.)

Code after:
    # Eve temperature offset with higher min/max
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="EveTemperatureOffset",
            device_class=NumberDeviceClass.TEMPERATURE,
            entity_category=EntityCategory.CONFIG,
            translation_key="temperature_offset",
            native_max_value=50,
            native_min_value=-50,
            native_step=0.5,
            native_unit_of_measurement=UnitOfTemperature.CELSIUS,
            device_to_ha=lambda x: None if x is None else x / 10,
            ha_to_device=lambda x: round(x * 10),
            mode=NumberMode.BOX,
        ),
        entity_class=MatterNumber,
        required_attributes=(
            clusters.Thermostat.Attributes.LocalTemperatureCalibration,
        ),
        vendor_id=(4874,),  # Eve Systems
    ),
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="TemperatureOffset",
            device_class=NumberDeviceClass.TEMPERATURE,
            entity_category=EntityCategory.CONFIG,
            translation_key="temperature_offset",
            native_max_value=25,  # Matter 1.3 limit
            native_min_value=-25,  # Matter 1.3 limit
            native_step=0.5,
            native_unit_of_measurement=UnitOfTemperature.CELSIUS,
            device_to_ha=lambda x: None if x is None else x / 10,
            ha_to_device=lambda x: round(x * 10),
            mode=NumberMode.BOX,
        ),
        entity_class=MatterNumber,
        required_attributes=(
            clusters.Thermostat.Attributes.LocalTemperatureCalibration,
        ),
    ),
    MatterDiscoverySchema(
        platform=Platform.NUMBER,
        entity_description=MatterNumberEntityDescription(
            key="pump_setpoint",
            native_unit_of_measurement=PERCENTAGE,
            translation_key="pump_setpoint",
            native_max_value=100,
            native_min_value=0.5,
            native_step=0.5,