[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 = ""
|
||||
widget.set("temp", "n/a")
|
||||
widget.set("transition", None)
|
||||
widget.set("state", "day")
|
||||
for line in res.split("\n"):
|
||||
if "temperature" in line.lower():
|
||||
line = line.lower()
|
||||
if "temperature" in line:
|
||||
widget.set("temp", line.split(" ")[2])
|
||||
if "period" in line.lower():
|
||||
state = line.split(" ")[1].lower()
|
||||
if "period" in line:
|
||||
state = line.split(" ")[1]
|
||||
if "day" in state:
|
||||
widget.set("state", "day")
|
||||
elif "night" in state:
|
||||
|
|
Loading…
Reference in a new issue