Defining manually configured MQTT entities directly under the respective platform keys (e.g., fan, light, sensor, etc.) is deprecated, and support will be removed in Home Assistant Core 2022.9.
Manually configured MQTT entities should now be defined under the mqtt configuration key in configuration.yaml instead of under the platform key.
Update HomeAssistant Examples
Defining manually configured MQTT entities directly under the respective platform keys (e.g., fan, light, sensor, etc.) is deprecated, and support will be removed in Home Assistant Core 2022.9.
Manually configured MQTT entities should now be defined under the mqtt configuration key in configuration.yaml instead of under the platform key.
https://www.home-assistant.io/blog/2022/06/01/release-20226/#breaking-changes