Skip to content

Commit

Permalink
Bangle.js: find my phone
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Sep 29, 2024
1 parent 459269e commit d00c503
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 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,7 +332,14 @@ 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") {

Expand Down

0 comments on commit d00c503

Please sign in to comment.