|
@@ -181,14 +181,14 @@ class BridgeState:
|
|
|
self._speaker_changed = False
|
|
self._speaker_changed = False
|
|
|
|
|
|
|
|
new_lines.extend(textwrap.wrap(text, MAX_LINE_CHARS) or [""])
|
|
new_lines.extend(textwrap.wrap(text, MAX_LINE_CHARS) or [""])
|
|
|
- self._display.extend(new_lines)
|
|
|
|
|
- self._display = self._display[-DISPLAY_LINES:]
|
|
|
|
|
- while len(self._display) < DISPLAY_LINES:
|
|
|
|
|
- self._display.insert(0, "")
|
|
|
|
|
-
|
|
|
|
|
- payload = json.dumps({"lines": list(self._display)})
|
|
|
|
|
- mqtt_client.publish(MQTT_TOPIC_TEXT, payload)
|
|
|
|
|
- print(f"[Display] {self._display}")
|
|
|
|
|
|
|
+ for line in new_lines:
|
|
|
|
|
+ self._display.append(line)
|
|
|
|
|
+ self._display = self._display[-DISPLAY_LINES:]
|
|
|
|
|
+ while len(self._display) < DISPLAY_LINES:
|
|
|
|
|
+ self._display.insert(0, "")
|
|
|
|
|
+ payload = json.dumps({"lines": list(self._display)})
|
|
|
|
|
+ mqtt_client.publish(MQTT_TOPIC_TEXT, payload)
|
|
|
|
|
+ print(f"[Display] {self._display}")
|
|
|
|
|
|
|
|
def clear(self, mqtt_client: mqtt.Client) -> None:
|
|
def clear(self, mqtt_client: mqtt.Client) -> None:
|
|
|
with self._lock:
|
|
with self._lock:
|