Il controllo continua con l'app in background (0.3.1)

- non si ferma piu' quando la pagina perde il primo piano: il polling vive
  dentro l'app e si spegne chiudendo l'app
- il conto alla rovescia a schermo gira solo con la pagina visibile
- dichiarato il limite di sistema: Sailfish puo' congelare un'app in background,
  e in quel caso l'avviso arriva alla riapertura
- post e descrizione allineati alla 0.3.1 (nomi, impronte, comportamento)
This commit is contained in:
kaneda committed 2026-10-20 13:54:52 +02:00
1 parent feee03756b
commit 3687c0d24c
7 files changed
+62 -33

No files matched your search

+8 -4
View File
@@ -14,13 +14,17 @@ Page {
allowedOrientations: Orientation.All allowedOrientations: Orientation.All
// La macchina si aggiorna solo mentre la schermata e' in primo piano: // Nessun ponte e nessun servizio che gira di nascosto: il controllo vive
// niente ponte, niente servizio che gira di nascosto. // dentro l'app e si spegne quando l'app viene chiusa.
onStatusChanged: { onStatusChanged: {
// Il conto alla rovescia a schermo gira solo quando la pagina si vede.
api.setScreenVisible(status === PageStatus.Active)
// Il controllo invece NON si ferma quando l'app va in background: resta
// attivo finche' il processo vive, e si spegne chiudendo l'app. Il
// sistema puo' congelare un'app in background: se lo fa, i timer si
// fermano comunque e la notifica arriva alla riapertura.
if (status === PageStatus.Active) if (status === PageStatus.Active)
api.startPolling() api.startPolling()
else
api.stopPolling()
} }
SilicaFlickable { SilicaFlickable {
+9 -1
View File
@@ -1,6 +1,6 @@
Name: harbour-thinq Name: harbour-thinq
Summary: Control an LG ThinQ washing machine Summary: Control an LG ThinQ washing machine
Version: 0.3.0 Version: 0.3.1
Release: 1 Release: 1
Group: Qt/Qt Group: Qt/Qt
License: MIT License: MIT
@@ -26,6 +26,14 @@ ThinQ Connect cloud from the phone: no server in between. The access token
is stored only on the device, in the app private configuration file. is stored only on the device, in the app private configuration file.
%changelog %changelog
* Mon Oct 12 2026 Carlo - 0.3.1-1
- il controllo non si ferma piu' quando l'app passa in background: continua
finche' il processo vive, e si spegne chiudendo l'app
- il conto alla rovescia a schermo gira solo quando la pagina si vede: in
background non si consuma per ricalcolare un numero che nessuno guarda
- limite noto (di sistema, non dell'app): Sailfish puo' congelare un'app in
background; in quel caso i timer si fermano e l'avviso arriva alla riapertura
* Mon Oct 12 2026 Carlo - 0.3.0-1 * Mon Oct 12 2026 Carlo - 0.3.0-1
- un controllo ogni mezz'ora invece di ogni 45 secondi, sempre e solo mentre la - un controllo ogni mezz'ora invece di ogni 45 secondi, sempre e solo mentre la
schermata e' aperta: nessun servizio in background, nessun processo che resta schermata e' aperta: nessun servizio in background, nessun processo che resta
+2 -2
View File
@@ -21,7 +21,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
app->setOrganizationName(QStringLiteral("harbour")); app->setOrganizationName(QStringLiteral("harbour"));
app->setApplicationName(QStringLiteral("thinq")); app->setApplicationName(QStringLiteral("thinq"));
app->setApplicationVersion(QStringLiteral("0.3.0")); app->setApplicationVersion(QStringLiteral("0.3.1"));
Settings settings; Settings settings;
ThinQClient api(&settings); ThinQClient api(&settings);
@@ -34,7 +34,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QQuickView *view = SailfishApp::createView(); QQuickView *view = SailfishApp::createView();
// Prima riga del log: dice se il device sta girando la build nuova o una stale. // Prima riga del log: dice se il device sta girando la build nuova o una stale.
qDebug() << "harbour-thinq v0.3.0 build" << __DATE__ << __TIME__; qDebug() << "harbour-thinq v0.3.1 build" << __DATE__ << __TIME__;
view->rootContext()->setContextProperty(QStringLiteral("appSettings"), &settings); view->rootContext()->setContextProperty(QStringLiteral("appSettings"), &settings);
view->rootContext()->setContextProperty(QStringLiteral("api"), &api); view->rootContext()->setContextProperty(QStringLiteral("api"), &api);
+11 -1
View File
@@ -41,7 +41,9 @@ ThinQClient::ThinQClient(Settings *settings, QObject *parent)
// (cioe' a schermata aperta). // (cioe' a schermata aperta).
m_tickTimer.setInterval(kTickMs); m_tickTimer.setInterval(kTickMs);
connect(&m_tickTimer, &QTimer::timeout, this, [this]() { connect(&m_tickTimer, &QTimer::timeout, this, [this]() {
if (m_pollTimer.isActive()) // Solo se la pagina si vede: in background nessuno guarda il numero e
// non vale la pena ricalcolarlo ogni minuto.
if (m_screenVisible && m_pollTimer.isActive())
emit devicesChanged(); emit devicesChanged();
}); });
@@ -192,10 +194,18 @@ void ThinQClient::startPolling()
m_tickTimer.start(); m_tickTimer.start();
} }
void ThinQClient::setScreenVisible(bool visible)
{
m_screenVisible = visible;
if (visible && !m_tickTimer.isActive())
m_tickTimer.start();
}
void ThinQClient::stopPolling() void ThinQClient::stopPolling()
{ {
m_pollTimer.stop(); m_pollTimer.stop();
m_tickTimer.stop(); m_tickTimer.stop();
m_screenVisible = false;
emit pollingChanged(); emit pollingChanged();
} }
+4
View File
@@ -59,6 +59,9 @@ public:
Q_INVOKABLE void sendDelayAt(int index); Q_INVOKABLE void sendDelayAt(int index);
Q_INVOKABLE void startPolling(); Q_INVOKABLE void startPolling();
Q_INVOKABLE void stopPolling(); Q_INVOKABLE void stopPolling();
// Il conto alla rovescia a schermo serve solo quando la pagina si vede: il
// controllo invece continua anche con l'app in background.
Q_INVOKABLE void setScreenVisible(bool visible);
Q_INVOKABLE void clearNotice(); Q_INVOKABLE void clearNotice();
Q_INVOKABLE void reloadCredentials(); Q_INVOKABLE void reloadCredentials();
Q_INVOKABLE QString durationText(int minutes) const; Q_INVOKABLE QString durationText(int minutes) const;
@@ -115,6 +118,7 @@ private:
bool m_stateInFlight = false; bool m_stateInFlight = false;
int m_pollInterval = 1800000; // mezz'ora, e solo a schermata aperta int m_pollInterval = 1800000; // mezz'ora, e solo a schermata aperta
int m_delayHours = 4; int m_delayHours = 4;
bool m_screenVisible = false; // pagina davanti agli occhi
bool m_busy = false; bool m_busy = false;
QString m_notice; QString m_notice;
bool m_noticeIsError = false; bool m_noticeIsError = false;
+6 -5
View File
@@ -52,11 +52,12 @@ WHAT IT DOES NOT DO
can get accounts blocked by LG, so this app does not offer it. can get accounts blocked by LG, so this app does not offer it.
* No wash program selection. The machine's own API does not expose it, so the * No wash program selection. The machine's own API does not expose it, so the
program is still chosen on the machine. program is still chosen on the machine.
* No hidden background service. The app polls only while it is on screen, once * No hidden background service, no daemon: the check lives inside the app and
every 30 minutes, and backs off by itself when LG reports too many requests keeps running while the app is open, including in the background; it stops when
(once an hour). The time left keeps counting down between checks because it is the app is closed. LG is read once every 30 minutes, and the time left keeps
recalculated on the phone. That is why the end-of-wash notification can arrive counting down between checks because it is recalculated on the phone. Sailfish
up to half an hour after the cycle ends. may freeze a background app to save power; if it does, the notification arrives
when the app is opened again.
NOT AFFILIATED WITH LG NOT AFFILIATED WITH LG
+22 -20
View File
@@ -55,21 +55,21 @@ uname -m
| device | file | link | | device | file | link |
|---|---|---| |---|---|---|
| 64-bit (`aarch64`) | `harbour-thinq-0.3.0-1.aarch64.rpm` (100 KB) | https://nextcloud.hackatoniclife.com/s/kXmJFokw9Ld6HNs | | 64-bit (`aarch64`) | `harbour-thinq-0.3.1-1.aarch64.rpm` (100 KB) | https://nextcloud.hackatoniclife.com/s/kXmJFokw9Ld6HNs |
| 32-bit (`armv7l`) | `harbour-thinq-0.3.0-1.armv7hl.rpm` (96 KB) | https://nextcloud.hackatoniclife.com/s/MPHaQLmfLSrZkMR | | 32-bit (`armv7l`) | `harbour-thinq-0.3.1-1.armv7hl.rpm` (96 KB) | https://nextcloud.hackatoniclife.com/s/MPHaQLmfLSrZkMR |
Checksums, if you like to verify downloads: Checksums, if you like to verify downloads:
``` ```
c8a4ecdf2f4fbe59f5948162a7fa82bac6bd315df6ea541b645eb5f3d6f9105f harbour-thinq-0.3.0-1.aarch64.rpm ef2553735ece863a22292fc7db5ad725bb82dc83158be37fc8c847fdfc0f0fb5 harbour-thinq-0.3.1-1.aarch64.rpm
0ac2ed5be803e16c4f7c1a180c1a9d984462fb3b528027f7dced1010c578312a harbour-thinq-0.3.0-1.armv7hl.rpm 16cc58996409f7b4ca925785111d2f8e9729a59dc8af479550c5c5b704705804 harbour-thinq-0.3.1-1.armv7hl.rpm
``` ```
**3. Install it** — either tap the downloaded file in Files and confirm, or from **3. Install it** — either tap the downloaded file in Files and confirm, or from
the terminal (developer mode): the terminal (developer mode):
``` ```
devel-su rpm -Uvh harbour-thinq-0.3.0-1.aarch64.rpm devel-su rpm -Uvh harbour-thinq-0.3.1-1.aarch64.rpm
``` ```
**4. First run** — paste your token, pick your country code (IT is the default), **4. First run** — paste your token, pick your country code (IT is the default),
@@ -90,12 +90,13 @@ screen.
can get accounts blocked by LG, so the app does not offer it. can get accounts blocked by LG, so the app does not offer it.
* No wash program selection. The machine's API does not expose it, so the * No wash program selection. The machine's API does not expose it, so the
program is still chosen on the machine. program is still chosen on the machine.
* No hidden background service. It checks LG once every 30 minutes, and only * No hidden background service, no daemon: the check lives inside the app. It
while the app is on screen; between one check and the next the time left is reads LG once every 30 minutes, keeps doing so while the app is in the
recalculated on the phone, so the countdown keeps moving without any network background, and stops when you close the app. Between one check and the next
call. If LG reports too many requests, the check drops to once an hour. That the time left is recalculated on the phone, so the countdown keeps moving
is also why the end-of-wash notification can arrive up to half an hour after without any network call. If LG reports too many requests, the check drops to
the cycle ends — without a server in the middle there is no push. once an hour. Sailfish may freeze background apps to save power; if it does,
the end-of-wash notification arrives when you open the app again.
### Privacy ### Privacy
@@ -168,14 +169,14 @@ uname -m
| dispositivo | file | link | | dispositivo | file | link |
|---|---|---| |---|---|---|
| 64 bit (`aarch64`) | `harbour-thinq-0.3.0-1.aarch64.rpm` (100 KB) | https://nextcloud.hackatoniclife.com/s/kXmJFokw9Ld6HNs | | 64 bit (`aarch64`) | `harbour-thinq-0.3.1-1.aarch64.rpm` (100 KB) | https://nextcloud.hackatoniclife.com/s/kXmJFokw9Ld6HNs |
| 32 bit (`armv7l`) | `harbour-thinq-0.3.0-1.armv7hl.rpm` (96 KB) | https://nextcloud.hackatoniclife.com/s/MPHaQLmfLSrZkMR | | 32 bit (`armv7l`) | `harbour-thinq-0.3.1-1.armv7hl.rpm` (96 KB) | https://nextcloud.hackatoniclife.com/s/MPHaQLmfLSrZkMR |
**3. Installala** — tocca il file scaricato in File e conferma, oppure dal **3. Installala** — tocca il file scaricato in File e conferma, oppure dal
terminale (modalità sviluppatore): terminale (modalità sviluppatore):
``` ```
devel-su rpm -Uvh harbour-thinq-0.3.0-1.aarch64.rpm devel-su rpm -Uvh harbour-thinq-0.3.1-1.aarch64.rpm
``` ```
**4. Primo avvio** — incolla il token, scegli il codice paese (l'Italia è **4. Primo avvio** — incolla il token, scegli il codice paese (l'Italia è
@@ -195,12 +196,13 @@ sullo stato.
password può far bloccare l'account da LG, quindi l'app non lo offre. password può far bloccare l'account da LG, quindi l'app non lo offre.
* Niente scelta del programma di lavaggio: l'API della macchina non lo espone, * Niente scelta del programma di lavaggio: l'API della macchina non lo espone,
quindi il programma si sceglie ancora sulla macchina. quindi il programma si sceglie ancora sulla macchina.
* Nessun servizio nascosto in background. Il controllo avviene una volta ogni * Nessun servizio nascosto e nessun demone: il controllo vive dentro l'app. Legge
mezz'ora, e solo mentre l'app è aperta; fra un controllo e l'altro il tempo LG una volta ogni mezz'ora, continua anche con l'app in background e si ferma
rimanente viene ricalcolato sul telefono, così il conto alla rovescia scende quando chiudi l'app. Fra un controllo e l'altro il tempo rimanente viene
senza chiamare la rete. Se LG segnala troppe richieste si passa a una volta ricalcolato sul telefono, così il conto alla rovescia scende senza chiamare la
l'ora. Per questo l'avviso di fine lavaggio può arrivare fino a mezz'ora dopo rete. Se LG segnala troppe richieste si passa a una volta l'ora. Sailfish può
la fine del ciclo: senza un server in mezzo non c'è notifica spinta. congelare le app in background per risparmiare: se lo fa, l'avviso di fine
lavaggio arriva alla riapertura.
### Privacy ### Privacy