def METHOD_NAME(self) -> Decimal | StateType:
    """Return the state of the sensor."""
    if self.rounding_digits and self._state is not None:
        return round(self._state, self.rounding_digits)
    return self._state