Skip to content

Commit

Permalink
Merge pull request #357 from jmlich/amazfit-neo-notifications
Browse files Browse the repository at this point in the history
AmazfitNeo notification is using AlertNotificationService
  • Loading branch information
piggz authored Apr 28, 2024
2 parents 855a835 + 4371b25 commit 26a3722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion daemon/src/devices/huamidevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HuamiDevice : public AbstractDevice

void applyDeviceSetting(Settings s) override;

void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
void incomingCall(const QString &caller) override;

QString softwareRevision();
Expand Down
11 changes: 8 additions & 3 deletions daemon/src/devices/neodevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ int NeoDevice::supportedFeatures() const

void NeoDevice::sendAlert(const QString &sender, const QString &subject, const QString &message)
{
MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
if (mi) {
mi->sendAlert(sender, subject, message);

AlertNotificationService *alert = qobject_cast<AlertNotificationService*>(service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION));

qDebug() << Q_FUNC_INFO << alert;

if (alert) {
alert->sendAlert(sender.left(10), subject.left(6), "");
}

}

void NeoDevice::serviceEvent(uint8_t event)
Expand Down

0 comments on commit 26a3722

Please sign in to comment.