Custom_component for notification


I’m implementing a custom_component to use Opsgenie service as a “notify” component.

When I look at a similar “notify” component to understand how it works (e.g. I see that can be mostly empty.

However, when I try to load my component, the log says “Setup failed for opsgenie: No setup function defined.”

So indeed, the doc says that I need to implement setup (even if the “discord” component doesn’t need for some reason).

So I did

"""The opsgenie component."""

DOMAIN = "opsgenie"

from homeassistant.core import HomeAssistant

_LOGGER = logging.getLogger(__name__)

async def async_setup(hass: HomeAssistant, config: dict):
    """Set up the Opsgenie component."""

    if DOMAIN not in config:
        return True

        hass.helpers.discovery.async_load_platform("notify", DOMAIN, {}, config)

    return True

While no error show up in the logs, and I do have an “opsgenie:” entry in configuration.yaml, nothing shows up in the Developer Tools GUI.

I’m a bit lost there… first time I develop for Home Assistant.

Any help is appreciated :slight_smile: