How can I get the HA IP using appdaemon?

I am experimenting making a websocket between the client and our “app” (app is pretty much non existent as we’re just testing). We need to get the IP of the clients HA module dynamically, so we can have a connection between AppDaemon and the client.

We’re using python. Libraries being used are: websocket and appdaemon just for this part of the project. Is there any additional libraries I need for this, or are there built-in functions to the libraries I already have that can get the HA IP for me?

Checkout the HassPlugin class under hassplugin.py. You can see various things like ha_key, ha_token, ha_url, etc are stored under that class when the plugin is initialized.

Where do I find hassplugin.py?