def speed_count(self):
        """Return the number of speeds the fan supports."""
        if self._prop_percentage:
            return round(self._prop_percentage.range_max() / self._prop_percentage.range_step())
        lst = [v for v in self.speed_list if v not in OFF_SPEED_VALUES]
        return len(lst)
Return the number of speeds the fan supports.
custom_components/xiaomi_miot/fan.py