We've had solid-state thermoelectric generators for a while that convert heat flux directly to electricity, they're just really inefficient (only 5-8% efficent). [0] I can't find anything suggesting a fundamental limit to the efficiency, but it would take a lot to catch up to steam-powered generators at 33%-48% efficiency [1].