MMM-ProfileSwitcher
MMM-ProfileSwitcher copied to clipboard
Request: "List" of available profiles
Hi @tosti007,
This is a great module. I would like to integrate a panel into my Remote-Control, which allows switching profiles from there. Could you add a designated point to get all available profiles? Maybe some notification after all modules are initialized, which send out possible values of profiles? This way I could catch this notification, if this module is installed, and present the user a list of available profiles.
Best regards
Hey Jopyth, Great to hear that you like my module! It's great to hear that you want to intergrate my module into yours! After the doms are created I loop once through all the modules so I think it would definetly be possible to add push all the values to an array/object. Currently the magicmirror framework adds the names of the modules itself to the "classes" aswell. Do you want me to remove them from the result that is being send out?
Basically, I would want to know which values are possible as a payload for the notification this.sendNotification('CURRENT_PROFILE', 'DESIRED_PROFILE_NAME_HERE');. So probably it is better to remove the module names from the classes, since they do not represent real profiles (and it would clutter the visible list of available profiles also).
Alright, i made a seperate branch (named AllProfiles). I think this would be what you are looking for. If you pull this branch, give it a test and let me know if it's what you want then i will add it to the master branch
Woops, i made a mistake with the payload. The payload will be an array of the profile names
Thanks, will try to test this tomorrow.
Does it work like this to get al the profiles?
notification : CURRENT_PROFILE payload: AllProfiles
Because this is not working with the API call.