Skip to content

Linux + iPhone Continuity / iMessage / SMS

feat(ui): show phone battery, carrier, signal strength in UI

Zack Bartel43581bbeb733
diff --git a/po/cs.po b/po/cs.po
index 6002b6c..9bfd314 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -707,8 +707,8 @@ msgstr "žádný operátor"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " signál {0}/5 baterie {1}/5"
+msgid " signal {}/5"
+msgstr " signál {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -718,6 +718,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Hovory (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Baterie"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Nepodařilo se načíst diagnostiku Bluetooth od démona.\n"
@@ -3251,6 +3255,10 @@ msgstr "Spárujte zařízení a synchronizujte schránku po síti"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Zprávy;Schránka;Soubory;Oznámení;Hovory;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " signál {0}/5 baterie {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/de.po b/po/de.po
index 994a46c..b398d24 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -717,8 +717,8 @@ msgstr "kein Netzbetreiber"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " Signal {0}/5 Akku {1}/5"
+msgid " signal {}/5"
+msgstr " Signal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -728,6 +728,10 @@ msgstr "Roaming"
msgid "Calls (HFP)"
msgstr "Anrufe (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Akku"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Die Bluetooth-Diagnose konnte nicht vom Daemon gelesen werden.\n"
@@ -3326,6 +3330,10 @@ msgstr ""
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Nachrichten;Zwischenablage;Dateien;Mitteilungen;Anrufe;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " Signal {0}/5 Akku {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/es.po b/po/es.po
index b708030..4fe5cbf 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -716,8 +716,8 @@ msgstr "sin operador"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " señal {0}/5 batería {1}/5"
+msgid " signal {}/5"
+msgstr " señal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -727,6 +727,10 @@ msgstr "itinerancia"
msgid "Calls (HFP)"
msgstr "Llamadas (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Batería"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "No se pudieron leer los diagnósticos de Bluetooth del daemon.\n"
@@ -3303,6 +3307,10 @@ msgstr "Empareje dispositivos y sincronice el portapapeles a través de la red"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Mensajes;Portapapeles;Archivos;Notificaciones;Llamadas;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " señal {0}/5 batería {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/fr.po b/po/fr.po
index 9480f3a..fb94e19 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -719,8 +719,8 @@ msgstr "aucun opérateur"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " signal {0}/5 batterie {1}/5"
+msgid " signal {}/5"
+msgstr " signal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -730,6 +730,10 @@ msgstr "itinérance"
msgid "Calls (HFP)"
msgstr "Appels (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Batterie"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Impossible de lire les diagnostics Bluetooth depuis le démon.\n"
@@ -3314,6 +3318,10 @@ msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr ""
"iPhone;iOS;SMS;Messages;Presse-papiers;Fichiers;Notifications;Appels;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " signal {0}/5 batterie {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/it.po b/po/it.po
index 892c917..62560a1 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -716,8 +716,8 @@ msgstr "nessun operatore"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " segnale {0}/5 batteria {1}/5"
+msgid " signal {}/5"
+msgstr " segnale {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -727,6 +727,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Chiamate (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Batteria"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Impossibile leggere la diagnostica Bluetooth dal daemon.\n"
@@ -3298,6 +3302,10 @@ msgstr "Accoppia dispositivi e sincronizza gli appunti sulla rete"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Messaggi;Appunti;File;Notifiche;Chiamate;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " segnale {0}/5 batteria {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/ja.po b/po/ja.po
index 91f4f60..6bdae7d 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -704,8 +704,8 @@ msgstr "通信事業者なし"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " 信号 {0}/5 バッテリー {1}/5"
+msgid " signal {}/5"
+msgstr " 信号 {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -715,6 +715,10 @@ msgstr "ローミング"
msgid "Calls (HFP)"
msgstr "通話 (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "バッテリー"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "デーモンから Bluetooth の診断情報を読み取れませんでした。\n"
@@ -3258,6 +3262,10 @@ msgstr "デバイスをペアリングし、ネットワーク越しにクリッ
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;メッセージ;クリップボード;ファイル;通知;通話;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " 信号 {0}/5 バッテリー {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/ko.po b/po/ko.po
index 7ba1752..b531efc 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -693,8 +693,8 @@ msgstr "통신사 없음"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " 신호 {0}/5 배터리 {1}/5"
+msgid " signal {}/5"
+msgstr " 신호 {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -704,6 +704,10 @@ msgstr "로밍"
msgid "Calls (HFP)"
msgstr "통화 (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "배터리"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "데몬에서 Bluetooth 진단 정보를 읽지 못했습니다.\n"
@@ -3214,6 +3218,10 @@ msgstr "기기를 페어링하고 네트워크를 통해 클립보드를 동기
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;메시지;클립보드;파일;알림;통화;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " 신호 {0}/5 배터리 {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/nl.po b/po/nl.po
index d76c247..d5589fe 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -715,8 +715,8 @@ msgstr "geen provider"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " signaal {0}/5 batterij {1}/5"
+msgid " signal {}/5"
+msgstr " signaal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -726,6 +726,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Oproepen (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Batterij"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Kon de Bluetooth-diagnostiek niet van de daemon lezen.\n"
@@ -3290,6 +3294,10 @@ msgstr "Apparaten koppelen en het klembord over het netwerk synchroniseren"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Berichten;Klembord;Bestanden;Meldingen;Gesprekken;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " signaal {0}/5 batterij {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/pl.po b/po/pl.po
index a9dab92..e0ca399 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -716,8 +716,8 @@ msgstr "brak operatora"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " sygnał {0}/5 bateria {1}/5"
+msgid " signal {}/5"
+msgstr " sygnał {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -727,6 +727,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Połączenia (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Bateria"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Nie udało się odczytać diagnostyki Bluetooth od demona.\n"
@@ -3283,6 +3287,10 @@ msgstr "Sparuj urządzenia i synchronizuj schowek przez sieć"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Wiadomości;Schowek;Pliki;Powiadomienia;Połączenia;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " sygnał {0}/5 bateria {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 32f074b..79225c7 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -713,8 +713,8 @@ msgstr "sem operadora"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " sinal {0}/5 bateria {1}/5"
+msgid " signal {}/5"
+msgstr " sinal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -724,6 +724,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Chamadas (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Bateria"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Não foi possível ler o diagnóstico do Bluetooth no daemon.\n"
@@ -3287,6 +3291,10 @@ msgstr ""
"iPhone;iOS;SMS;Mensagens;Área de "
"transferência;Arquivos;Notificações;Chamadas;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " sinal {0}/5 bateria {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/ru.po b/po/ru.po
index 09e1830..c676208 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -716,8 +716,8 @@ msgstr "нет оператора"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " сигнал {0}/5 батарея {1}/5"
+msgid " signal {}/5"
+msgstr " сигнал {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -727,6 +727,10 @@ msgstr "роуминг"
msgid "Calls (HFP)"
msgstr "Вызовы (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Батарея"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Не удалось прочитать диагностику Bluetooth у демона.\n"
@@ -3288,6 +3292,10 @@ msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr ""
"iPhone;iOS;SMS;Сообщения;Буфер обмена;Файлы;Уведомления;Звонки;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " сигнал {0}/5 батарея {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/sv.po b/po/sv.po
index 391e1de..4c3c2d4 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -709,8 +709,8 @@ msgstr "ingen operatör"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " signal {0}/5 batteri {1}/5"
+msgid " signal {}/5"
+msgstr " signal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -720,6 +720,10 @@ msgstr "roaming"
msgid "Calls (HFP)"
msgstr "Samtal (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Batteri"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Kunde inte läsa Bluetooth-diagnostiken från demonen.\n"
@@ -3256,6 +3260,10 @@ msgstr "Parkoppla enheter och synkronisera urklipp över nätverket"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Meddelanden;Urklipp;Filer;Notiser;Samtal;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " signal {0}/5 batteri {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/tether.pot b/po/tether.pot
index 4825f52..202fc9e 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: tether 0.2.42\n"
+"Project-Id-Version: tether 0.2.43\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -640,7 +640,7 @@ msgstr ""
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
+msgid " signal {}/5"
msgstr ""
#: src/cli/main.cpp src/ui_common/ui_text.cpp
@@ -651,6 +651,10 @@ msgstr ""
msgid "Calls (HFP)"
msgstr ""
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr ""
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index 1f735a5..c0e0d16 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -704,8 +704,8 @@ msgstr "operatör yok"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " sinyal {0}/5 pil {1}/5"
+msgid " signal {}/5"
+msgstr " sinyal {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -715,6 +715,10 @@ msgstr "dolaşım"
msgid "Calls (HFP)"
msgstr "Çağrılar (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Pil"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Bluetooth tanılaması arka plan hizmetinden okunamadı.\n"
@@ -3251,6 +3255,10 @@ msgstr "Aygıtları eşleştirin ve panoyu ağ üzerinden eşzamanlayın"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;Mesajlar;Pano;Dosyalar;Bildirimler;Aramalar;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " sinyal {0}/5 pil {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/uk.po b/po/uk.po
index 21d7690..4c987e6 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -716,8 +716,8 @@ msgstr "немає оператора"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " сигнал {0}/5 батарея {1}/5"
+msgid " signal {}/5"
+msgstr " сигнал {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -727,6 +727,10 @@ msgstr "роумінг"
msgid "Calls (HFP)"
msgstr "Виклики (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "Батарея"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "Не вдалося прочитати діагностику Bluetooth у демона.\n"
@@ -3282,6 +3286,10 @@ msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr ""
"iPhone;iOS;SMS;Повідомлення;Буфер обміну;Файли;Сповіщення;Дзвінки;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " сигнал {0}/5 батарея {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/po/zh_CN.po b/po/zh_CN.po
index efdf70e..a493027 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-25 20:55-0700\n"
+"POT-Creation-Date: 2026-10-27 21:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -674,8 +674,8 @@ msgstr "无运营商"
#: src/cli/main.cpp
#, c++-format
-msgid " signal {0}/5 battery {1}/5"
-msgstr " 信号 {0}/5 电量 {1}/5"
+msgid " signal {}/5"
+msgstr " 信号 {}/5"
#: src/cli/main.cpp src/ui_common/ui_text.cpp
msgid "roaming"
@@ -685,6 +685,10 @@ msgstr "漫游"
msgid "Calls (HFP)"
msgstr "通话 (HFP)"
+#: src/cli/main.cpp
+msgid "Battery"
+msgstr "电量"
+
#: src/cli/main.cpp
msgid "Could not read Bluetooth diagnostics from the daemon.\n"
msgstr "无法从守护进程读取蓝牙诊断信息。\n"
@@ -3138,6 +3142,10 @@ msgstr "配对设备并通过网络同步剪贴板"
msgid "iPhone;iOS;SMS;Messages;Clipboard;Files;Notifications;Calls;AirPods;"
msgstr "iPhone;iOS;SMS;信息;剪贴板;文件;通知;通话;AirPods;"
+#, c++-format
+#~ msgid " signal {0}/5 battery {1}/5"
+#~ msgstr " 信号 {0}/5 电量 {1}/5"
+
#~ msgid ""
#~ "Where messages and contacts are stored on this computer. Encrypted keeps "
#~ "them with a key in your desktop keyring. Do not keep deletes what is "
diff --git a/src/cli/main.cpp b/src/cli/main.cpp
index bf65c94..aceb8f9 100644
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -855,12 +855,15 @@ static int print_bt_connection(tether::Client& client) {
// Carrier and signal come from the phone over HFP.
const std::string carrier = calls.value("operator", "");
call_state += " [" + (carrier.empty() ? std::string(_("no carrier")) : carrier) +
- tether::tr_format(_(" signal {0}/5 battery {1}/5"),
- std::to_string(calls.value("signal", 0)),
- std::to_string(calls.value("battery", 0))) +
+ tether::tr_format(_(" signal {}/5"), std::to_string(calls.value("signal", 0))) +
(calls.value("roaming", false) ? std::string(" ") + _("roaming") : std::string{}) + "]";
}
fields.emplace_back(_("Calls (HFP)"), call_state);
+ const auto battery = resp.find("battery");
+ fields.emplace_back(_("Battery"),
+ battery != resp.end() && battery->is_number_integer()
+ ? std::to_string(battery->get<int>()) + "%"
+ : _("unknown"));
print_fields(fields);
const std::string link = resp.value("link_reason", "");
diff --git a/src/core/include/tether/bluetooth/objects.hpp b/src/core/include/tether/bluetooth/objects.hpp
index 0b44112..586e71b 100644
--- a/src/core/include/tether/bluetooth/objects.hpp
+++ b/src/core/include/tether/bluetooth/objects.hpp
@@ -81,6 +81,9 @@ namespace tether::bluetooth {
// Device1.PreferredBearer: "le", "bredr" or "last-seen".
std::string preferred_bearer;
+ // org.bluez.Battery1 Percentage, -1 when BlueZ exposes none.
+ int battery = -1;
+
bool has_le_bearer = false;
bool le_paired = false;
bool le_bonded = false;
diff --git a/src/core/src/bluetooth/connection.cpp b/src/core/src/bluetooth/connection.cpp
index cf47454..ae1ee30 100644
--- a/src/core/src/bluetooth/connection.cpp
+++ b/src/core/src/bluetooth/connection.cpp
@@ -335,6 +335,21 @@ namespace tether::bluetooth {
return address;
}
+ // Percent from the LE Battery Service, else HFP's 0-5 level, else null.
+ nlohmann::json
+ phone_battery(const BluezMonitor* monitor, const std::string& address, const nlohmann::json& calls) {
+ if (monitor) {
+ const std::string wanted = normalize_address(address);
+ for (const auto& device : monitor->snapshot().devices)
+ if (device.battery >= 0 && normalize_address(device.address) == wanted)
+ return device.battery;
+ }
+ if (calls.is_object() && calls.value("available", false) && calls.value("indicators", true) &&
+ calls.value("battery", 0) > 0)
+ return calls.value("battery", 0) * 20;
+ return nullptr;
+ }
+
// Bearer operations backed by BlueZ on the system bus.
class BluezBearerOps : public BearerOps {
public:
@@ -817,6 +832,7 @@ namespace tether::bluetooth {
nlohmann::json payload = to_json(bearers->status(), profiles->status());
auto client = calls_client();
payload["calls"] = client ? client->status() : nlohmann::json(nullptr);
+ payload["battery"] = phone_battery(monitor, address, payload["calls"]);
std::lock_guard<std::mutex> lock(status_mutex);
payload["ancs_ready"] = ancs_ready;
payload["ancs_reason"] = ancs_reason;
diff --git a/src/core/src/bluetooth/objects.cpp b/src/core/src/bluetooth/objects.cpp
index 23f2c92..0929cd0 100644
--- a/src/core/src/bluetooth/objects.cpp
+++ b/src/core/src/bluetooth/objects.cpp
@@ -23,6 +23,7 @@ namespace tether::bluetooth {
constexpr const char* IFACE_BEARER_LE = "org.bluez.Bearer.LE1";
constexpr const char* IFACE_BEARER_BREDR = "org.bluez.Bearer.BREDR1";
constexpr const char* IFACE_CHARACTERISTIC = "org.bluez.GattCharacteristic1";
+ constexpr const char* IFACE_BATTERY = "org.bluez.Battery1";
constexpr const char* UUID_ANCS_NOTIFICATION_SOURCE = "9fbf120d-6301-42d9-8c58-25e699a21dbd";
constexpr const char* UUID_GAP_DEVICE_NAME = "00002a00-0000-1000-8000-00805f9b34fb";
@@ -298,6 +299,14 @@ namespace tether::bluetooth {
g_variant_unref(br);
}
+ if (GVariant* battery = g_variant_lookup_value(ifaces, IFACE_BATTERY, G_VARIANT_TYPE("a{sv}"))) {
+ if (GVariant* v = g_variant_lookup_value(battery, "Percentage", G_VARIANT_TYPE_BYTE)) {
+ d.battery = g_variant_get_byte(v);
+ g_variant_unref(v);
+ }
+ g_variant_unref(battery);
+ }
+
out.devices.push_back(std::move(d));
}
diff --git a/src/gtk/calls_view.cpp b/src/gtk/calls_view.cpp
index 9bcf71e..a508db8 100644
--- a/src/gtk/calls_view.cpp
+++ b/src/gtk/calls_view.cpp
@@ -273,8 +273,8 @@ namespace tether::ui {
gtk_widget_set_sensitive(g_calls.entry, g_calls.available);
gtk_widget_set_sensitive(g_calls.dial_button, g_calls.available);
- set_text(g_calls.network_label, g_calls.available ? network_text(calls) : "");
- set_accessible_name(g_calls.network_label, g_calls.available ? network_text(calls, true) : "");
+ set_text(g_calls.network_label, g_calls.available ? phone_status_text(event) : "");
+ set_accessible_name(g_calls.network_label, g_calls.available ? phone_status_text(event, true) : "");
const std::string reason = calls.is_object() ? calls.value("reason", "") : "";
const std::string audio = calls.is_object() ? calls.value("audio", "") : "";
diff --git a/src/gtk/devices_view.cpp b/src/gtk/devices_view.cpp
index 8d5ffa7..234fb03 100644
--- a/src/gtk/devices_view.cpp
+++ b/src/gtk/devices_view.cpp
@@ -162,6 +162,13 @@ namespace tether::ui {
set_accessible_name(label, spoken.empty() ? text : spoken);
}
+ void set_phone_label(GtkWidget* label) {
+ const std::string text = phone_status_text(g_devices.bt_connection);
+ set_text(label, text);
+ set_accessible_name(label, text.empty() ? "" : phone_status_text(g_devices.bt_connection, true));
+ gtk_widget_set_visible(label, !text.empty());
+ }
+
// The daemon supervises one iPhone at a time, so the live profile status
// describes whichever Bluetooth device is bonded, not the one merely
// selected in the list.
@@ -1184,6 +1191,14 @@ namespace tether::ui {
set_battery_label(battery, g_devices.bt_airpods, airpods_row_text(g_devices.bt_airpods));
g_object_set_data(G_OBJECT(row), "bt_battery", battery);
gtk_box_pack_start(GTK_BOX(labels), battery, FALSE, FALSE, 0);
+ } else if (is_supervised_bt_device(address)) {
+ GtkWidget* status = gtk_label_new(nullptr);
+ gtk_label_set_xalign(GTK_LABEL(status), 0.0);
+ gtk_style_context_add_class(gtk_widget_get_style_context(status), "muted");
+ gtk_widget_set_no_show_all(status, TRUE);
+ set_phone_label(status);
+ g_object_set_data(G_OBJECT(row), "bt_phone_status", status);
+ gtk_box_pack_start(GTK_BOX(labels), status, FALSE, FALSE, 0);
}
gtk_box_pack_start(GTK_BOX(box), labels, TRUE, TRUE, 0);
@@ -1548,6 +1563,24 @@ namespace tether::ui {
if (detail.empty() && connected)
detail = _("Messages and notifications are connected.");
set_route_status(Route::Bluetooth, connected, detail);
+
+ std::string phone_name;
+ GList* rows = gtk_container_get_children(GTK_CONTAINER(g_devices.list_devices));
+ for (GList* item = rows; item; item = item->next) {
+ auto* status = GTK_WIDGET(g_object_get_data(G_OBJECT(item->data), "bt_phone_status"));
+ if (!status)
+ continue;
+ set_phone_label(status);
+ if (const char* name = (const char*)g_object_get_data(G_OBJECT(item->data), "name"))
+ phone_name = name;
+ }
+ g_list_free(rows);
+ const auto battery = event.find("battery");
+ tray_set_phone(phone_name.empty() ? "iPhone" : phone_name,
+ battery != event.end() && battery->is_number_integer()
+ ? std::to_string(battery->get<int>()) + "%"
+ : "");
+
update_right_pane();
// A status broadcast, not a command this view owns: the Messages and
// Notifications views need the same event.
diff --git a/src/gtk/tray.cpp b/src/gtk/tray.cpp
index 05ac911..0a48656 100644
--- a/src/gtk/tray.cpp
+++ b/src/gtk/tray.cpp
@@ -72,6 +72,8 @@ namespace tether::ui {
std::string g_tooltip;
std::string g_airpods_name;
std::string g_airpods_battery;
+ std::string g_phone_name;
+ std::string g_phone_battery;
bool g_close_to_tray = false;
std::string g_icon_style = "symbolic";
std::string g_icon_suffix;
@@ -249,6 +251,8 @@ namespace tether::ui {
// TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
tooltip += tether::tr_format(_("{}: {}"), route_name(route), status) + "\n";
}
+ if (!g_phone_battery.empty())
+ tooltip += tether::tr_format(_("{}: {}"), g_phone_name, g_phone_battery) + "\n";
if (!g_airpods_battery.empty())
tooltip += tether::tr_format(_("{}: {}"), g_airpods_name, g_airpods_battery) + "\n";
if (!daemon_connected())
@@ -280,6 +284,14 @@ namespace tether::ui {
tray_refresh();
}
+ void tray_set_phone(const std::string& name, const std::string& battery) {
+ if (name == g_phone_name && battery == g_phone_battery)
+ return;
+ g_phone_name = name;
+ g_phone_battery = battery;
+ tray_refresh();
+ }
+
void tray_set_unread(int count) {
if (count == g_unread)
return;
diff --git a/src/gtk/tray.hpp b/src/gtk/tray.hpp
index 19174a0..7416edf 100644
--- a/src/gtk/tray.hpp
+++ b/src/gtk/tray.hpp
@@ -19,6 +19,9 @@ namespace tether::ui {
// nothing connected, or the channel has reported nothing yet.
void tray_set_airpods(const std::string& name, const std::string& battery);
+ // The supervised iPhone's battery for the tooltip; empty hides the line.
+ void tray_set_phone(const std::string& name, const std::string& battery);
+
// Repaints from cached state, for when the daemon returns before any route event.
void tray_refresh();
diff --git a/src/tui/app.hpp b/src/tui/app.hpp
index bd98b6c..b74f858 100644
--- a/src/tui/app.hpp
+++ b/src/tui/app.hpp
@@ -119,6 +119,7 @@ namespace tether::tui {
void set_route(Route route, bool ok, const std::string& detail);
void set_unread(int unread);
void set_airpods(const std::string& name, const std::string& battery);
+ void set_phone(const std::string& name, const std::string& battery);
} // namespace app
diff --git a/src/tui/calls.cpp b/src/tui/calls.cpp
index 587558d..2a3cda8 100644
--- a/src/tui/calls.cpp
+++ b/src/tui/calls.cpp
@@ -166,7 +166,7 @@ namespace tether::tui {
if (command == "bt_connection_changed") {
const json calls = event.contains("calls") ? event["calls"] : json();
available_ = calls.is_object() && calls.value("available", false);
- network_ = available_ ? ui::network_text(calls) : "";
+ network_ = available_ ? ui::phone_status_text(event) : "";
const std::string reason = calls.is_object() ? calls.value("reason", "") : "";
const std::string audio = calls.is_object() ? calls.value("audio", "") : "";
audio_routable_ = !audio.empty() && audio != "active";
diff --git a/src/tui/devices.cpp b/src/tui/devices.cpp
index fcb61e8..03c6ab4 100644
--- a/src/tui/devices.cpp
+++ b/src/tui/devices.cpp
@@ -146,6 +146,9 @@ namespace tether::tui {
if (airpods && bt_airpods_.value("address", "") == address) {
const std::string battery = ui::airpods_status_text(bt_airpods_);
subtitle += "\n " + (battery.empty() ? std::string(_("Reading battery…")) : battery);
+ } else if (!airpods && is_supervised(address)) {
+ if (const std::string status = ui::phone_status_text(bt_connection_); !status.empty())
+ subtitle += "\n " + status;
}
Row row = device_row(name, subtitle, BT_PREFIX + address);
row.tone = route_ready || (airpods && is_connected) ? Tone::Good : Tone::Normal;
@@ -390,6 +393,15 @@ namespace tether::tui {
if (detail.empty() && route_up)
detail = _("Messages and notifications are connected.");
app::set_route(app::Route::Bluetooth, route_up, detail);
+ std::string phone_name = "iPhone";
+ for (const auto& device : bt_devices_)
+ if (is_supervised(device.value("address", "")) && !device.value("name", "").empty())
+ phone_name = device.value("name", "");
+ const auto battery = event.find("battery");
+ app::set_phone(phone_name,
+ battery != event.end() && battery->is_number_integer()
+ ? std::to_string(battery->get<int>()) + "%"
+ : "");
// A broadcast the Messages and Notifications pages need too.
return false;
}
diff --git a/src/tui/main.cpp b/src/tui/main.cpp
index df2f79a..c35fb0e 100644
--- a/src/tui/main.cpp
+++ b/src/tui/main.cpp
@@ -128,6 +128,8 @@ namespace tether::tui {
int unread = 0;
std::string airpods_name;
std::string airpods_battery;
+ std::string phone_name;
+ std::string phone_battery;
// Rows from the last frame, so keys act on what is on screen.
std::vector<Row> list_rows;
@@ -504,6 +506,8 @@ namespace tether::tui {
void draw_status_line(int y, int width) {
fill(y, 0, width, COLOR_PAIR(P_BAR));
std::vector<std::string> parts = {route_text(app::Route::WiFi), route_text(app::Route::Bluetooth)};
+ if (!g.phone_battery.empty())
+ parts.push_back(tr_format(_("{}: {}"), g.phone_name, g.phone_battery));
if (!g.airpods_battery.empty())
parts.push_back(tr_format(_("{}: {}"), g.airpods_name, g.airpods_battery));
if (g.daemon_fd < 0)
@@ -1360,6 +1364,11 @@ namespace tether::tui {
g.airpods_battery = battery;
}
+ void set_phone(const std::string& name, const std::string& battery) {
+ g.phone_name = name;
+ g.phone_battery = battery;
+ }
+
} // namespace app
} // namespace tether::tui
diff --git a/src/ui_common/ui_text.cpp b/src/ui_common/ui_text.cpp
index 9bca974..1e428d3 100644
--- a/src/ui_common/ui_text.cpp
+++ b/src/ui_common/ui_text.cpp
@@ -126,10 +126,23 @@ namespace tether::ui {
}
if (calls.value("roaming", false))
out += gap + _("roaming");
- if (const int battery = calls.value("battery", 0); battery > 0) {
- const std::string level = std::to_string(battery * 20) + "%";
+ return out;
+ }
+
+ std::string phone_status_text(const nlohmann::json& connection, bool spoken) {
+ if (!connection.is_object())
+ return {};
+ std::string out;
+ if (const auto it = connection.find("battery"); it != connection.end() && it->is_number_integer()) {
+ const std::string level = std::to_string(it->get<int>()) + "%";
// TRANSLATORS: The iPhone's battery level read aloud, {} is like "80%".
- out += gap + (spoken ? tether::tr_format(_("battery {}"), level) : level);
+ out = spoken ? tether::tr_format(_("battery {}"), level) : level;
+ }
+ const auto calls = connection.find("calls");
+ if (calls != connection.end() && calls->is_object() && calls->value("available", false)) {
+ const std::string network = network_text(*calls, spoken);
+ if (!network.empty())
+ out += (out.empty() ? "" : (spoken ? ", " : " ")) + network;
}
return out;
}
diff --git a/src/ui_common/ui_text.hpp b/src/ui_common/ui_text.hpp
index 8f44be7..c967edb 100644
--- a/src/ui_common/ui_text.hpp
+++ b/src/ui_common/ui_text.hpp
@@ -30,9 +30,12 @@ namespace tether::ui {
const char* call_state_text(const std::string& state);
// What HFP reports about the phone's cellular link. "spoken" replaces the
- // bar glyphs and bare percentage with words for screen readers.
+ // bar glyphs with words for screen readers.
std::string network_text(const nlohmann::json& calls, bool spoken = false);
+ // The phone's battery then its cellular link, from a bt_connection payload.
+ std::string phone_status_text(const nlohmann::json& connection, bool spoken = false);
+
// Time of day for today's calls, the date as well for older ones.
std::string format_call_time(int64_t epoch);
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a0f491a..080f308 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -35,6 +35,7 @@ add_executable(tether_test
test_service.cpp
test_verbs.cpp
../src/ui_common/message_format.cpp
+ ../src/ui_common/ui_text.cpp
../src/tui/util.cpp
../src/cli/verbs.cpp
)
diff --git a/test/test_bluetooth_objects.cpp b/test/test_bluetooth_objects.cpp
index cb5fb01..373698b 100644
--- a/test/test_bluetooth_objects.cpp
+++ b/test/test_bluetooth_objects.cpp
@@ -246,6 +246,22 @@ TEST(BluetoothObjects, BondedFallsBackToPaired) {
EXPECT_TRUE(objects.devices[0].bonded);
}
+TEST(BluetoothObjects, ReadsBatteryPercentage) {
+ Payload p(R"({
+ '/org/bluez/hci0/dev_AA': {
+ 'org.bluez.Device1': { 'Address': <'AA'> },
+ 'org.bluez.Battery1': { 'Percentage': <byte 89> }
+ },
+ '/org/bluez/hci0/dev_BB': {
+ 'org.bluez.Device1': { 'Address': <'BB'> }
+ }
+ })");
+ auto objects = parse_managed_objects(p.v);
+ ASSERT_EQ(objects.devices.size(), 2u);
+ for (const auto& device : objects.devices)
+ EXPECT_EQ(device.battery, device.address == "AA" ? 89 : -1);
+}
+
TEST(BluetoothObjects, IgnoresUnexpectedPropertyTypes) {
// A string where a boolean belongs must not throw or corrupt the record.
Payload p(R"({
diff --git a/test/test_message_format.cpp b/test/test_message_format.cpp
index bfbdfe5..0665edc 100644
--- a/test/test_message_format.cpp
+++ b/test/test_message_format.cpp
@@ -1,4 +1,5 @@
#include "../src/ui_common/message_format.hpp"
+#include "../src/ui_common/ui_text.hpp"
#include <glib.h>
#include <gtest/gtest.h>
@@ -151,3 +152,13 @@ TEST(LinkifyMarkup, AlwaysProducesParseableMarkup) {
g_markup_parse_context_free(context);
}
}
+
+TEST(PhoneStatusText, BatteryAloneThenWithTheCellularLink) {
+ using tether::ui::phone_status_text;
+ EXPECT_EQ(phone_status_text(nlohmann::json{{"battery", 89}, {"calls", nullptr}}), "89%");
+ EXPECT_EQ(phone_status_text(nlohmann::json{{"battery", nullptr}, {"calls", nullptr}}), "");
+ const nlohmann::json calls = {
+ {"available", true}, {"indicators", true}, {"operator", "Carrier"}, {"service", true}, {"signal", 3}};
+ EXPECT_EQ(phone_status_text(nlohmann::json{{"battery", 89}, {"calls", calls}}), "89% Carrier ▆▆▆▁▁");
+ EXPECT_EQ(phone_status_text(nlohmann::json{{"battery", nullptr}, {"calls", calls}}), "Carrier ▆▆▆▁▁");
+}