diff --git a/clock.py b/clock.py index 44a1ece..f8c2e9f 100644 --- a/clock.py +++ b/clock.py @@ -286,7 +286,7 @@ class MyClockWidget(FloatLayout): [0.0, 160.0/255.0, 160.0/255.0], # 2.0 <= x < 3.0 cyan (good) [1.0, 1.0, 1.0], # 3.0 <= x < 4.0 white (mediocre) [1.0, 1.0, 150.0/255.0], # 4.0 <= < x 5.0 light yellow (mediocre) - [200.0/255.0, 200.0/255.0, 0.0], # 5.0 <= x < 6.0 yellow (mediocre) + [245.0/255.0, 245.0/255.0, 0.0], # 5.0 <= x < 6.0 yellow (mediocre) [1.0, 175.0/255.0, 0.0], # 6.0 <= x < 7.0 orange (inadequate) [1.0, 120.0/255.0, 0.0], # 7.0 <= x < 8.0 red orange (inadequate) [200.0/255.0, 0.0, 0.0], # 8.0 <= x < 9.0 red (bad) @@ -334,6 +334,7 @@ class MyClockWidget(FloatLayout): t = datetime.datetime.now().timestamp() j = json.loads(response.text) + # self.precipitation = [0, 0.1, 0.22, 0.47, 1, 2.2, 4.7, 10, 22, 47, 100] self.precipitation = self.get_air_quality_metric(j, t, "precipitation", 300) self.pollen = self.get_air_quality_metric(j, t, "pollen", 3600) self.aqi = self.get_air_quality_metric(j, t, "AQI", 3600) @@ -637,9 +638,10 @@ class MyClockWidget(FloatLayout): face_plate = self.ids["face_plate"] with face_plate.canvas: - colors = self.calculate_colors(x[:12], x_thresholds) + N = min(12, len(x)) + colors = self.calculate_colors(x[:N], x_thresholds) - for i in range(0, 12): + for i in range(0, N): color = colors[i] R = face_plate.size[0] / 2 r = R / 10