Replacing switch that controls both light and fan.
I have a ceiling fan that I want to replace (redoing the room). The switch in the room controls the full unit (light and the fan). I'd like the switch to only control the light in the new unit (https://www.amazon.com/dp/B098HH1MJ1) it's also wifi-enabled so I don't want that function to lose power with switch..
Switch for some reason has 3 lines + ground? The backstab came loose as soon as I pulled it and lost power to the fan/etc .. that seems to be the line-in? [see attached images]
Any help would be appreciated.
EDIT: Not sure why the images didn't post but here they are: https://imgur.com/a/1ZrA04i