Although I found examples on this website on how to change the brightness of the main screen, the methods used to implement that rely on the actions in KM which "increase" or "decrease" the brightness levels. There appears to be no way to "fetch" the brightness level for any screen, nor does their appear to be a way to "set" the brightness of the screen to a specific value, either using KM, AppleScript, or shell commands (without resorting to third party tools, which I won't do.)
You can't even adjust the brightness of a secondary (non-Apple) screen using System Preferences.
No doubt this is a limitation set by Apple because they didn't provide any public API for these functions.
There are some people online who provide an "ioreg command" which allegedly fetches the brightness level value of the main screen, but I couldn't get any of those commands to work on Sequoia. Has anyone been able to get this command to return the brightness level?
I'm mentioning this because I had decided today to write a macro which lets you set the brightness of the screen on a per-app basis. I did this once before with volume settings, but I'm hitting too many roadblocks when it comes to brightness settings. It looks like I won't be able to accomplish this goal.