From 8996635db05fcf260e4fb7806b6f0d1edc872193 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 16 May 2019 19:52:35 +0200 Subject: [PATCH] small improvement in pi-hole module * set status to 'pi-hole unknown' in case the pi-hole status cannot be retrieved. --- bumblebee/modules/pihole.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bumblebee/modules/pihole.py b/bumblebee/modules/pihole.py index 3ec6c9a..c0d10a2 100644 --- a/bumblebee/modules/pihole.py +++ b/bumblebee/modules/pihole.py @@ -30,7 +30,7 @@ class Module(bumblebee.engine.Module): def pihole_status(self, widget): if self._pihole_status is None: - return "unknown" + return "pi-hole unknown" return "pi-hole " + ("up/" + self._ads_blocked_today if self._pihole_status else "down") def update_pihole_status(self): @@ -61,8 +61,8 @@ class Module(bumblebee.engine.Module): self.update_pihole_status() def state(self, widget): - if self._pihole_status: + if self._pihole_status is None: + return [] + elif self._pihole_status: return ["enabled"] - elif not self._pihole_status: - return ["disabled", "warning"] - return [] + return ["disabled", "warning"]