Include active_profile in SDK data
Feature Request
It would be great if the SDK could include a active_profile property in the returned data, similar to active_mode.
Implementation suggestion
OpenRGB could determine the active_profile by comparing the current state with the profiles. If the current state matches some profile, then that profile is the active one. Because profiles are like state snapshots, I believe this makes sense.
It would be nice if OpenRGB kept track of when each profile was last applied. If the current state matches multiple profiles, then lastly applied one should be shown as the active one (see why below).
I have two identical profiles, one called Preferred and another called Red. In future, I may change Preferred to be some other color depending on my liking, but I would not update Red in that case. Having two different profiles prevents me from having to rewrite my automations in case I change my preferred color.
If there are currently less devices than a profile (i.e. a device was unplugged after profile creation), still consider the profile active based on the state of the current devices.
If there are currently more devices than a profile (i.e. a device was plugged after profile creation), then do not consider the profile active. Or should we consider the profile active as long as all the devices in a profile matches the state? I'm not sure.
Background
I wrote an OpenRGB integration for Home Assistant, and it was accepted by Home Assistant core as an official Home Assistant integration (see the introductory PR here).
I am currently working to add a profile selector to it, which should be extremely helpful:
For example: I have a Home Assistant automation that applies a different OpenRGB profile to my computer when I join a meeting. I also apply a different profile when my internet connection breaks, and then I restore to my preferred profile when none of these conditions match.
However, select entities in Home Assistant are not really meant for such one-way operation. It would provide the best user experience if we were able to determine the currently active profile (see the discussion here).
So... what do you think? Thanks for your time!