Assuming it works for other games (have you tried it?), could you go to the in-game settings and see if your
gamepad mode is set to
Force Off? Even if not, you could try toggling it on and off to see if it picks it up.
Failing that, you might check your Steam controller settings (right click Stardew Valley in your library, click Properties, click Controller. Mine look like this!) to make sure your controller is recognized, or try setting "Enable Steam Input" in the dropdown.