From f021250e418aa98f6188834f1125600fe74a3062 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Nov 2018 10:04:43 +0100 Subject: [PATCH] Using util function for boolean param --- bumblebee/modules/weather.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index eaf81a1..8676fc0 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -32,8 +32,8 @@ class Module(bumblebee.engine.Module): self._apikey = self.parameter("apikey", "af7bfe22287c652d032a3064ffa44088") self._location = self.parameter("location", "auto") self._city = self.parameter("location", "") + self._showcity = bumblebee.util.asbool(self.parameter("showcity", True)) self._unit = self.parameter("unit", "metric") - self._showcity = self.parameter("showcity", "true") self._valid = False self.interval(15) @@ -56,10 +56,10 @@ class Module(bumblebee.engine.Module): def output(self, widget): if not self._valid: return u"?" - if self._showcity == "false": - return self.temperature() - else: + if self._showcity: return self.city() + self.temperature() + else: + return self.temperature() def state(self, widget): if self._valid: