Correct handling of existing MQTT subscriptions (#43056)

This commit is contained in:
Erik Montnemery 2020-11-10 21:55:26 +01:00 committed by GitHub
parent d7bcf4a3b4
commit 4e49bd0596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 7 deletions

View file

@ -29,6 +29,7 @@ class EntitySubscription:
async def resubscribe_if_necessary(self, hass, other):
"""Re-subscribe to the new topic if necessary."""
if not self._should_resubscribe(other):
self.unsubscribe_callback = other.unsubscribe_callback
return
if other is not None and other.unsubscribe_callback is not None: