In HA, a switch can only be “on” or “off”… a dimmer provides other values, so it can’t be a switch.
or
Also…