Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into asteroid-devicein…
Browse files Browse the repository at this point in the history
…foservice
  • Loading branch information
jmlich committed Oct 14, 2024
2 parents da4cc8a + b3fe7cc commit 4ef9f3b
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
flatpak build-bundle ${{ github.workspace }}/repo ${{ github.workspace }}/uk.co.piggz.amazfish.flatpak uk.co.piggz.amazfish
- name: Upload Flatpak
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: uk.co.piggz.amazfish.flatpak
pattern: uk.co.piggz.amazfish.flatpak
path: uk.co.piggz.amazfish.flatpak
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These are devices I have, have tested, and will try not to break any functionali
* Amazfit GTS
* Amazfit GTR2
* Pinetime InfiniTime
* Bangle.js
* Bangle.js - [Android integration](https://gadgetbridge.org/gadgets/wearables/banglejs/) app should be installed

### Silver

Expand Down Expand Up @@ -151,3 +151,9 @@ Credits to:

The Gadgetbridge devs, which gave me a lot of hints and inspiration from their device code.
https://codeberg.org/Freeyourgadget/Gadgetbridge

## Automatic Reconnecting

Depending on device and operating system if there are problems with pairing or reconnecting you may need to take one action.
Open the bluetooth settings on your phone and head for known devices. There enter the settings for the watch and enable "reconnect automatically" for it.
This should fix pairing and reconnecting issues.
11 changes: 10 additions & 1 deletion daemon/daemon.pro
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,16 @@ HEADERS += \
src/activitycoordinate.h

TRANSLATIONS += \
translations/harbour-amazfishd-cs.ts
translations/harbour-amazfishd-cs.ts \
translations/harbour-amazfishd-de.ts \
translations/harbour-amazfishd-es.ts \
translations/harbour-amazfishd-fr.ts \
translations/harbour-amazfishd-nl.ts \
translations/harbour-amazfishd-pl.ts \
translations/harbour-amazfishd-ru.ts \
translations/harbour-amazfishd-sv.ts \
translations/harbour-amazfishd-zh_Hans.ts


flavor_uuitk {
DEFINES += TRANSLATION_FOLDER=\\\"/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/translations\\\"
Expand Down
48 changes: 39 additions & 9 deletions daemon/src/devices/banglejsdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ void BangleJSDevice::sendWeather(CurrentWeather *weather)
QJsonObject o;
o.insert("t", "weather");
o.insert("temp", weather->temperature());
o.insert("hum", weather->humidity());
o.insert("hum", weather->humidity());
o.insert("txt", weather->description());
o.insert("wind", weather->windSpeed());
o.insert("wdir", weather->windDeg());
o.insert("wind", weather->windSpeed());
o.insert("wdir", weather->windDeg());
o.insert("loc", weather->city()->name());

uart->txJson(o);
Expand Down Expand Up @@ -291,7 +291,7 @@ void BangleJSDevice::refreshInformation()

QString BangleJSDevice::information(Info i) const
{
qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO << i;

if (i == INFO_BATTERY) {
return QString::number(m_infoBatteryLevel);
Expand Down Expand Up @@ -332,21 +332,51 @@ void BangleJSDevice::handleRxJson(const QJsonObject &json)
m_infoBatteryLevel = json.value("bat").toInt();
emit informationChanged(INFO_BATTERY, QString::number(m_infoBatteryLevel));
} else if (t == "findPhone") {
bool running = json.value("n").toBool();
qDebug() << "findPhone" << running;
if (running) {
emit deviceEvent(AbstractDevice::EVENT_FIND_PHONE);
} else {
emit deviceEvent(AbstractDevice::EVENT_CANCEL_FIND_PHONE);

}

} else if (t == "music") {
QString music_action = json.value("n").toString();

if (music_action == "play") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_PLAY);
} else if (music_action == "pause") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_PAUSE);
} else if (music_action == "next") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_NEXT);
} else if (music_action == "previous") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_PREV);
} else if (music_action == "volumeup") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_VOLUP);
} else if (music_action == "volumedown") {
emit deviceEvent(AbstractDevice::EVENT_MUSIC_VOLDOWN);
}

// emit deviceEvent(AbstractDevice::EVENT_APP_MUSIC);

} else if (t == "call") {


} else if (t == "notify") {
// } else if (t == "call") {
// } else if (t == "notify") {
} else if (t == "act") {

long ts = json.value("ts").toInt(); // timestamp
int hrm = json.value("hrm").toInt(); // heart rate,
int stp = json.value("stp").toInt(); // steps
int mov = json.value("mov").toInt(); // movement intensity
int rt = json.value("rt").toInt();

} else if (t == "act") {
qDebug() << "parsed type = act " << ts << hrm << stp << mov << rt;

emit informationChanged(INFO_HEARTRATE, QString("%1").arg(hrm));
emit informationChanged(INFO_STEPS, QString("%1").arg(stp));

} else {
qDebug() << "Gadgetbridge type " << t;

}
#if 0
Expand Down
2 changes: 1 addition & 1 deletion daemon/src/services/uartservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void UARTService::handleRx(const QString &json)

if (json.contains( "Uncaught ReferenceError: \"gb\" is not defined")) {
emit message("Gadgetbridge plugin not installed on Bangle.js");
} else if (json.at(0)=='{') {
} else if ((json.length() > 0) && (json.at(0)=='{')) {
// JSON - we hope!
QJsonObject obj = ObjectFromString(json);
emit jsonRx(obj);
Expand Down
58 changes: 29 additions & 29 deletions daemon/translations/harbour-amazfishd-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,143 +5,143 @@
<name>AbstractDevice</name>
<message>
<source>Device does not support settings</source>
<translation type="unfinished"></translation>
<translation>Das Gerät unterstützt keine Einstellungen</translation>
</message>
</context>
<context>
<name>AsteroidOSDevice</name>
<message>
<source>Stored %1...</source>
<translation type="unfinished"></translation>
<translation>Gespeichert %1...</translation>
</message>
</context>
<context>
<name>BipDevice</name>
<message>
<source>Navigation Started</source>
<translation type="unfinished"></translation>
<translation>Navigation gestartet</translation>
</message>
<message>
<source>Navigation Stopped</source>
<translation type="unfinished"></translation>
<translation>Navigation gestoppt</translation>
</message>
<message>
<source>Progress</source>
<translation type="unfinished"></translation>
<translation>Fortschritt</translation>
</message>
</context>
<context>
<name>BipFirmwareService</name>
<message>
<source>An operation is currently running, please try later</source>
<translation type="unfinished"></translation>
<translation>Ein Vorgang wird derzeit ausgeführt, bitte versuchen Sie es später</translation>
</message>
<message>
<source>Sending %1...</source>
<translation type="unfinished"></translation>
<translation>%1 wird gesendet...</translation>
</message>
<message>
<source>No file selected</source>
<translation type="unfinished"></translation>
<translation>Keine Datei ausgewählt</translation>
</message>
</context>
<context>
<name>DeviceInterface</name>
<message>
<source>Device is not valid, it may not be supported</source>
<translation type="unfinished"></translation>
<translation>Das Gerät ist ungültig und wird möglicherweise nicht unterstützt</translation>
</message>
<message>
<source>Amazfish</source>
<translation type="unfinished"></translation>
<translation>Amazfish</translation>
</message>
<message>
<source>Connected</source>
<translation type="unfinished"></translation>
<translation>Verbunden</translation>
</message>
<message>
<source>Phone and watch are connected</source>
<translation type="unfinished"></translation>
<translation>Telefon und Uhr sind verbunden</translation>
</message>
<message>
<source>Low Battery</source>
<translation type="unfinished"></translation>
<translation>Schwache Batterie</translation>
</message>
<message>
<source>Battery level now </source>
<translation type="unfinished"></translation>
<translation>Akkustand jetzt </translation>
</message>
</context>
<context>
<name>DfuService</name>
<message>
<source>An operation is currently running, please try later</source>
<translation type="unfinished"></translation>
<translation>Ein Vorgang wird derzeit ausgeführt, bitte versuchen Sie es später</translation>
</message>
<message>
<source>No file selected</source>
<translation type="unfinished"></translation>
<translation>Keine Datei ausgewählt</translation>
</message>
</context>
<context>
<name>HuamiDevice</name>
<message>
<source>Navigation Started</source>
<translation type="unfinished"></translation>
<translation>Navigation gestartet</translation>
</message>
<message>
<source>Navigation Stopped</source>
<translation type="unfinished"></translation>
<translation>Navigation gestoppt</translation>
</message>
<message>
<source>Progress</source>
<translation type="unfinished"></translation>
<translation>Fortschritt</translation>
</message>
</context>
<context>
<name>MiBandService</name>
<message>
<source>Firmware is too old to set display items, V0.1.1.14 is required</source>
<translation type="unfinished"></translation>
<translation>Die Firmware ist zu alt, um Anzeigeelemente zu setzen, V0.1.1.14 wird benötigt</translation>
</message>
<message>
<source>An operation is currently running, please try later</source>
<translation type="unfinished"></translation>
<translation>Ein Vorgang wird derzeit ausgeführt, bitte versuchen Sie es später</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>About to transfer data from </source>
<translation type="unfinished"></translation>
<translation>Über das Übertragen von Daten aus </translation>
</message>
<message>
<source>Finished transferring activity data</source>
<translation type="unfinished"></translation>
<translation>Übergabe der Vorgangsdaten abgeschlossen</translation>
</message>
<message>
<source>No data to transfer</source>
<translation type="unfinished"></translation>
<translation>Es müssen keine Daten übertragen werden</translation>
</message>
<message>
<source>Update operation failed</source>
<translation type="unfinished"></translation>
<translation>Fehler beim Aktualisierungsvorgang</translation>
</message>
<message>
<source>Update operation failed, unexpected metadata</source>
<translation type="unfinished"></translation>
<translation>Fehler beim Updatevorgang, unerwartete Metadaten</translation>
</message>
<message>
<source>Update operation complete</source>
<translation type="unfinished"></translation>
<translation>Updatevorgang abgeschlossen</translation>
</message>
<message>
<source>Update operation failed, filetype not supported</source>
<translation type="unfinished"></translation>
<translation>Fehler beim Update-Vorgang, Dateityp wird nicht unterstützt</translation>
</message>
<message>
<source>File does not seem to be supported</source>
<translation type="unfinished"></translation>
<translation>Datei scheint nicht unterstützt zu werden</translation>
</message>
</context>
</TS>
1 change: 1 addition & 0 deletions documentation/build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build target which are not available by default.

To get into the build machine (if started by Sailfish IDE)
`ssh -l mersdk localhost -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk`
or `sfdk engine exec` with docker based builder

Use the `sb2-config` command to make your ARM target the default

Expand Down
2 changes: 1 addition & 1 deletion qble
Submodule qble updated 2 files
+13 −0 adaptermodel.cpp
+2 −0 adaptermodel.h
12 changes: 7 additions & 5 deletions ui/qml/pages/FirstPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ PagePL {
anchors.rightMargin: 2
height: parent.height - 4
}


}

RowLayout {
height: styler.themeItemSizeSmall
width: parent.width
Expand Down Expand Up @@ -149,7 +148,6 @@ PagePL {
}
}


SectionHeaderPL {
text: qsTr("Steps")
visible: supportsFeature(Amazfish.FEATURE_STEPS)
Expand All @@ -158,6 +156,8 @@ PagePL {
// steps
IconPL {
id: imgSteps
anchors.left: parent.left
anchors.leftMargin: styler.themePaddingLarge
iconName: styler.iconSteps
height: styler.themeIconSizeMedium
width: height
Expand Down Expand Up @@ -208,6 +208,10 @@ PagePL {

//Heartrate
RowLayout {
anchors.left: parent.left
anchors.leftMargin: styler.themePaddingLarge
anchors.right: parent.right
anchors.rightMargin: styler.themePaddingLarge
spacing: styler.themePaddingLarge
width: parent.width
visible: supportsFeature(Amazfish.FEATURE_HRM)
Expand Down Expand Up @@ -270,8 +274,6 @@ PagePL {
}
}
}


}

onPageStatusActive: {
Expand Down
7 changes: 6 additions & 1 deletion ui/qml/pages/Settings-app.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ PagePL {
textRole: "path"
label: qsTr("BT Adapter")
Component.onCompleted: {
cboLocalAdapter.value = AmazfishConfig.localAdapter;
for (var i = 0; i < adapters.rowCount(); i++) {
if (adapters.get(i).path == AmazfishConfig.localAdapter) {
cboLocalAdapter.currentIndex = i;
return
}
}
}
}

Expand Down
Loading

0 comments on commit 4ef9f3b

Please sign in to comment.