Closed nao-pon closed 2 years ago
You are right .. It was late in the night and I've missed the retun type None
But as I see in the old async_subscribe_topics
function there is a retun and it returns dictionary with the new state, so in the backward compatibility part we still need to assign the return to self._sub_state
Yes, assignments are made in the code part that guarantees backward compatibility. This part is for HA after 2022.3.
However, I think it's okay to substitute None
. I'm just a little worried because the other components of Core don't do the assignment, so I'll follow your instructions.😃
I prefer to assign the returned result, just because HA have implemented a logic, that automatically unsubscribe the old subscriptions or those that have not been passed to the "async_subscribe_topics" function .. Otherwise I dont mind both variants. As you say others don't assign it. The truth is that in HA you never know what is the right descision, and what comes next (release) .. :D https://github.com/home-assistant/core/blob/4d32e1ed01d6bd6cbf52e193acb33fb8e14d8462/homeassistant/components/mqtt/subscription.py#L96-L105
Probably don't need to assign return of
subscription.async_subscribe_topics
.https://github.com/home-assistant/core/blob/f3a89de71f6fa693016a41397b051bd48c86f841/homeassistant/components/mqtt/subscription.py#L118-L121