Problem calling an async library function

Hello guys :slight_smile:
I am developing an integration right now for a custom BLE air sensor. This device should be connected via BLE to the OS Home Assistant is running on. I wrote a package that does the connection an reading and now I face to problem on how to use my package as Home Assistant.

I look at the “Xiaomi Mijia BLE Temperature and Humidity Sensor” integration which creates a platform and inside an entity for each sensor (eg. air quality, temperature, humidity, etc.)

Now my question is from where do I call my connect_ble_device method? If I put the call in the async_setup_platform it delays the startup and also doesn’t even work. As soon as the call for the async method is made, nothing happens. The method is not actually called. My call looks like this:

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    ...
    device = hass.async_create_task(gateway.connect_ble_device(mac))
    ...

I hope this is the right place to ask. Thanks in advance for your help :slight_smile:

You might get a better/timely response if you post on the dev forums on discord…

Oh okay, thank you. A more timely response is not that important but if is better too I’ll try it there :smiley:

Yeah to be clear you probably won’t get any useful response in here at all…

Too bad :confused: why is this? I thought the forum is specifically for that matter.

Mainly only users post here not devs so discord should be your go-to. Just the way it is.

Okay, thank you :slight_smile: