~kennylevinsen/poweralertd

1f72dc38b56e9a9a85c662e28aedaf4d35b15f7d — Kenny Levinsen 22 days ago 7e6a348
Silence unknown battery messages
1 files changed, 4 insertions(+), 1 deletions(-)

M main.c
M main.c => main.c +4 -1
@@ 58,9 58,12 @@ static int send_state_update(sd_bus *bus, struct upower_device *device) {
	char msg[NOTIFICATION_MAX_LEN];

	switch (device->current.state) {
	case UPOWER_DEVICE_STATE_UNKNOWN:
		// Silence transitions to/from unknown
		device->current.state = device->last.state;
		return 0;
	case UPOWER_DEVICE_STATE_EMPTY:
	case UPOWER_DEVICE_STATE_PENDING_CHARGE:
	case UPOWER_DEVICE_STATE_UNKNOWN:
		urgency = URGENCY_CRITICAL;
		break;
	default: