koying / mqtt_discoverystream_ha

Extension of HA mqtt_statestream integration with discovery config publishing
11 stars 6 forks source link

Adapt to changed mqtt.async_publish in Home Assistant 2021.12 #2

Open emontnemery opened 2 years ago

emontnemery commented 2 years ago

mqtt.async_publish is a couroutine in HA core 2021.12: home-assistant/core#58441

This can be solved as suggested here: https://github.com/blakeblackshear/frigate-hass-integration/pull/166

If mqtt.async_publish is called from a non-coroutine, use hass.async_create_task if it's not practical to convert the caller to a coroutine:

hass.async_create_task(mqtt.async_publish(hass, topic, payload))
koying commented 2 years ago

Ok, thanks. You confirm 2021.12? Not aware of HA branching model, so 2021.11 has been branched off, already?

emontnemery commented 2 years ago

Yeah, it will be in 2021.12. 2021.11 was branched off yesterday, #58441 was merged right after that.