When a device is added via BlueZ it is first added at warning_level
"unknown" and then changes to "none".
This triggers a spurious notification about "Warning cleared" although
no warning was ever reported.
---
main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/main.c b/main.c
index 30ca4b5..20b1f25 100644
--- a/main.c+++ b/main.c
@@ -91,6 +91,10 @@ static int send_warning_update(sd_bus *bus, struct upower_device *device) {
return 0;
}
+ if (device->current.warning_level == UPOWER_DEVICE_LEVEL_NONE && device->last.warning_level == UPOWER_DEVICE_LEVEL_UNKNOWN) {+ return 0;+ }+ enum urgency urgency = URGENCY_CRITICAL;
char title[NOTIFICATION_MAX_LEN];
char *msg;
base-commit: 3c0c7c727db9c7fc03e790946541e2b2d0146cd2
--
2.34.1