diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 7a02f08410..d11de0505d 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -228,15 +228,17 @@ void APIConnection::loop() { } } -#ifdef USE_CAMERA - this->try_send_camera_image_(); -#endif - #ifdef USE_API_HOMEASSISTANT_STATES if (state_subs_at_ >= 0) { this->process_state_subscriptions_(); } #endif + +#ifdef USE_CAMERA + // Process camera last - state updates are higher priority + // (missing a frame is fine, missing a state update is not) + this->try_send_camera_image_(); +#endif } bool APIConnection::send_disconnect_response(const DisconnectRequest &msg) {