[modules/redshift] Minor refactoring
This commit is contained in:
parent
61e64044b6
commit
b8d05b435f
1 changed files with 5 additions and 3 deletions
|
@ -37,11 +37,13 @@ def get_redshift_value(widget):
|
||||||
res = ""
|
res = ""
|
||||||
widget.set("temp", "n/a")
|
widget.set("temp", "n/a")
|
||||||
widget.set("transition", None)
|
widget.set("transition", None)
|
||||||
|
widget.set("state", "day")
|
||||||
for line in res.split("\n"):
|
for line in res.split("\n"):
|
||||||
if "temperature" in line.lower():
|
line = line.lower()
|
||||||
|
if "temperature" in line:
|
||||||
widget.set("temp", line.split(" ")[2])
|
widget.set("temp", line.split(" ")[2])
|
||||||
if "period" in line.lower():
|
if "period" in line:
|
||||||
state = line.split(" ")[1].lower()
|
state = line.split(" ")[1]
|
||||||
if "day" in state:
|
if "day" in state:
|
||||||
widget.set("state", "day")
|
widget.set("state", "day")
|
||||||
elif "night" in state:
|
elif "night" in state:
|
||||||
|
|
Loading…
Reference in a new issue