~kennylevinsen/poweralertd-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] feat: don't send warning when changing from unknown to no warning

Thomas Weißschuh <thomas@t-8ch.de>
Details
Message ID
<20211207173215.25473-1-thomas@t-8ch.de>
DKIM signature
missing
Download raw message
Patch: +4 -0
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
Details
Message ID
<SUGY3R.JR0WBAR5DPXT2@kl.wtf>
In-Reply-To
<20211207173215.25473-1-thomas@t-8ch.de> (view parent)
DKIM signature
missing
Download raw message
Applied, thanks!
Reply to thread Export thread (mbox)