From b8d05b435f22d3b060e37cee2acf70e9045bde1f Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Wed, 16 Jan 2019 20:13:28 +0100 Subject: [PATCH] [modules/redshift] Minor refactoring --- bumblebee/modules/redshift.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bumblebee/modules/redshift.py b/bumblebee/modules/redshift.py index a60edbc..47b9cc4 100644 --- a/bumblebee/modules/redshift.py +++ b/bumblebee/modules/redshift.py @@ -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: