Repository: home-assistant/core
File: homeassistant/components/tuya/type_information.py (Python)

Code before:
    def process_raw_value(
        self, raw_value: Any | None, device: CustomerDevice
    ) -> str | None:
        """Read and process raw value against this type information."""
        if raw_value is None:
            return None
        # Validate input against defined range
        if raw_value not in self.range:
            if _should_log_warning(
                device.id, f"enum_out_range|{self.dpcode}|{raw_value}"
            ):
                LOGGER.warning(
                    "Found invalid enum value `%s` for datapoint `%s` in product "
                    "id `%s`, expected one of `%s`; please report this defect to "
                    "Tuya support",
                    raw_value,
                    self.dpcode,
                    device.product_id,
                    self.range,
                )
            return None
        return raw_value

    @classmethod
    def _from_json(
        cls, dpcode: str, type_data: str, *, report_type: str | None = None
    ) -> Self | None:
        """Load JSON string and return an EnumTypeInformation object."""
        if not (parsed := json_loads_object(type_data)):
            return None
        return cls(
            dpcode=dpcode,
            type_data=type_data,
            **cast(dict[str, list[str]], parsed),
        )


@dataclass(kw_only=True)
class IntegerTypeInformation(TypeInformation[float]):
    """Integer type information."""

    _DPTYPE = DPType.INTEGER

    min: int
    max: int
    scale: int
    step: int
    unit: str | None = None
    report_type: str | None = None

    def scale_value(self, value: int) -> float:

Review comment (suggestion):
```suggestion
        cls, dpcode: str, type_data: str, *, report_type: str | None
```

Code after:

    def process_raw_value(
        self, raw_value: Any | None, device: CustomerDevice
    ) -> str | None:
        """Read and process raw value against this type information."""
        if raw_value is None:
            return None
        # Validate input against defined range
        if raw_value not in self.range:
            if _should_log_warning(
                device.id, f"enum_out_range|{self.dpcode}|{raw_value}"
            ):
                LOGGER.warning(
                    "Found invalid enum value `%s` for datapoint `%s` in product "
                    "id `%s`, expected one of `%s`; please report this defect to "
                    "Tuya support",
                    raw_value,
                    self.dpcode,
                    device.product_id,
                    self.range,
                )
            return None
        return raw_value

    @classmethod
    def _from_json(
        cls, dpcode: str, type_data: str, *, report_type: str | None
    ) -> Self | None:
        """Load JSON string and return an EnumTypeInformation object."""
        if not (parsed := json_loads_object(type_data)):
            return None
        return cls(
            dpcode=dpcode,
            type_data=type_data,
            **cast(dict[str, list[str]], parsed),
        )


@dataclass(kw_only=True)
class IntegerTypeInformation(TypeInformation[float]):
    """Integer type information."""

    _DPTYPE = DPType.INTEGER

    min: int
    max: int
    scale: int
    step: int
    unit: str | None = None
    report_type: str | None