All sorts of companies make thermostatic controlled shower/tub valves, I have one in my shower. As noted, though, you set the max temp, and it tries to achieve that value by mixing the incoming hot and cold. If there isn't enough hot, it keeps attempting to produce the set temp by limiting the cold mixed into it.
By codes, you must have a valve like this or a pressure balancing valve to prevent inadvertent, unintended hot spurts caused by pressure problems. A properly installed valve will also have a high temp limiting adjustment, but that doesn't work too well on the pressure balanced valves since people can change the WH thermostat, which, since it is a mix and the limit is how far you can turn the hot valve open, only indirectly affects the max temperature achievable.
A second thing between thermostatically controlled vs pressure-balance is that typically with a pressure-balance, you get no flow control - it is either full on or off. A thermostatically controlled valve usually has a volume control (thus at least two controls). On mine, the volume is a two way valve with a built-in diverter. You turn it one way for the tub, and the other way for the shower. I almost never change the temperature setting.