I don't think it has a sensor to detect that. I'd expect to have to manually adjust that in the desktop settings to match the physical orientation.
I'm not sure why the ring of light turns off like that, and then turns back on. My first thought is it might be a loose cable. The ring of light is either powered by the power supply for the monitor, or the USB cable. It could be that the USB cable gets loose during rotation. When I experimented with rotating the screen, I was also adjusting the height at the same time, and I noticed it pulled and pushed around some of my cables.