fix(mqtt): force event topic resubscribe on reconnect [consent: user-approved]
This commit is contained in:
@@ -919,8 +919,12 @@ def main():
|
||||
logging.info(f"Subscribed to: {group_id_topic}")
|
||||
|
||||
# Wenn beim Start eine group_id vorhanden ist, sofort Event-Topic abonnieren
|
||||
# Reset event_topic so subscribe_event_topic always re-registers with the broker
|
||||
# (broker loses all subscriptions on reconnect, even if our local state still has it)
|
||||
if current_group_id:
|
||||
logging.info(f"Subscribing to event topic for saved group_id: {current_group_id}")
|
||||
nonlocal event_topic
|
||||
event_topic = None # force re-subscribe regardless of previous state
|
||||
subscribe_event_topic(current_group_id)
|
||||
|
||||
# Send discovery message after reconnection to re-register with server
|
||||
|
||||
Reference in New Issue
Block a user