Looking for examples using python to set hue color via HA

I have a couple of python programs I wrote before I found HA. They use the Phue package to simulate a sunrise and a sunset with hue color bulbs. I’d like to convert them to use the HA Python API instead of Phue, but I’m having a hard time finding examples to show the Python calls with enough detail so I can do that.