Custom_component for notification

Hello,

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. https://github.com/home-assistant/core/blob/52d8c66a8b17fd9e096e2b164202a59512852751/homeassistant/components/discord/init.py) I see that init.py 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.async_create_task(
        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:

Laurent