Gazebo Sim 8.8.0 Harmonic Control Spot Light on Ubuntu 22.04

Good morning All,
I’m trying to create cpp script to control a spotlight during the simulation. I’m not able to find anything on the documentation. Do you have a snippet code that I can use to learn how to do that? For now I have create an SDF file that place a spot light in gazebo and a plugin in cpp linked to this model, but when I publish the message to change for example the color it not works.

Thank you very much for any suggestions

Not 100% sure, but seems you need to access to it with EntityComponentManager, for inspiration maybe you can check this code gz-sim/src/Light.cc at gz-sim9 · gazebosim/gz-sim · GitHub