Using util function for boolean param
This commit is contained in:
parent
19e6abc8ca
commit
f021250e41
1 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue