Yes, but keep in mind that a single ESPHome component (ie climate) may provide multiple entities/channels, and retrieving those names from the esphome yaml would probably require parsing C++ code as well.
State updates from the device are done using a unique 32 bit key, and not by transmitting the full entity/channel name. The key is provided during the interrogation step. I’m not sure whether they are static across a reboot, but I’m pretty sure they won’t be static across a flashing process (ie version upgrade or modification).
So you cannot skip the interrogation step.
As I wrote in an earlier post:
Wouldn’t a “A python yaml to items generator” solve it?
Do you mean that if the device doesn’t actually provide all statically configured channels, the thing
should refuse to go online? Opposed to some centralized logic checking for broken links every X seconds and informing you about the problem - and that applies for all kinds of thing types?
Wouldn’t a general tool be even more awesome? See Adjust width of F7 dialog + include clipboard icon - #5 by splatch
(Specific: In order to interrogate an ESPHome device you would have to provide credentials in most cases)