Custom Component: Maxsmart v1.30 (Revogi)

Hi,

I’m about to (re)create a custom component to manage Maxsmart v1.30 power strips.

This uses a local http API in the form of GET commands only. Quite simple to operate. Yet, I’m unable to understand how to create the objects. I used cookiecutter to get the template.

Would anyone have an example of a platform using similar API based on cookiecutter for me to look at ?

Right now I’m stuck at the beginning: init.py

Without a clear example using http calls, I don’t understand what I’m supposed to put there… And searching for the keywords gives me nothing.

    hass.data.setdefault(DOMAIN, {})
    # TODO 1. Create API instance
    # TODO 2. Validate the API connection (and authentication)
    # TODO 3. Store an API object for your platforms to access
    # hass.data[DOMAIN][entry.entry_id] = MyApi(...)

The API has been documented by @altery on github (thank you :slight_smile: ). I made some reverse engineering a long time ago, but nothing as extensive :). Very helpful. GitHub - Superkikim/mh-maxsmart-powerstation: Protocol to control the Max Hauri MaxSMART Powerstation (SOP111)

Hello there.

Does anyone can help ? or point me in the right direction to find help ?

Or am I in the wrong forum topic ?