🐛 Ensure subscription changes cause a history message (#4752)

This commit is contained in:
Christian Würthner authored and GitHub committed 2023-06-20 17:03:02 +02:00
1 parent 388e45ae11
commit c0c6b6829a
1 file changed
+4 -2
+4 -2
View File
@@ -381,10 +381,12 @@ class PrinterStateConnection(
self._subscriptions["plugins"] = plugins
self._subscriptions["events"] = events
if state and not old_state:
# trigger initial data
if state and state != old_state:
# state is requested and was changed from previous state
# we should send a history message to send the update data
self._printer.send_initial_callback(self)
elif old_state and not state:
# we no longer should send state updates
self._initial_data_sent = False
def on_printer_send_current_data(self, data):