async def async_set_direction(self, direction: str):
        """Set the direction of the fan"""
        self._direction = direction

        if not self._speed.lower() == SPEED_OFF:
            await self.send_command()

        self.async_write_ha_state()
Set the direction of the fan
custom_components/smartir/fan.py