def percentage(self):
        """Return the current speed as a percentage."""
        if self._miot_property.value_range:
            val = self._miot_property.from_device(self.device)
            if val is not None:
                return round(val / self._miot_property.range_max() * 100, 2)
        return super().percentage
Return the current speed as a percentage.
custom_components/xiaomi_miot/fan.py