|
@@ -5,13 +5,13 @@ from poll import set_target_temp, get_current_temp
|
5
|
5
|
|
6
|
6
|
def draw_graph(lcd, min, val, max):
|
7
|
7
|
if max == min:
|
8
|
|
- lcd.text("{} -> {} -> {}".format(min, val, max), 0, int(lcd.height / 2) - 5, lcd.white)
|
|
8
|
+ lcd.textC("{} -> {} -> {}".format(min, val, max), int(self.lcd.width / 2), int(lcd.height / 2), lcd.white)
|
9
|
9
|
return
|
10
|
10
|
|
11
|
11
|
ratio = (val - min) / (max - min)
|
12
|
12
|
lcd.pie(lcd.width / 2, lcd.height / 2, lcd.width - 30, lcd.red, lcd.green, ratio)
|
13
|
13
|
|
14
|
|
- lcd.text("{} / {}".format(val, max), int(lcd.width / 2), int(lcd.height / 2) - 5, lcd.white)
|
|
14
|
+ lcd.textC("{} / {}".format(val, max), int(lcd.width / 2), int(lcd.height / 2), lcd.white)
|
15
|
15
|
|
16
|
16
|
class StateWaitTemp:
|
17
|
17
|
def __init__(self, lcd):
|
|
@@ -64,7 +64,7 @@ class StateWaitTemp:
|
64
|
64
|
|
65
|
65
|
async with self.lock:
|
66
|
66
|
if self.temp == 0.0:
|
67
|
|
- self.lcd.text("Setting temperature...", 0, int(self.lcd.height / 2) - 5, self.lcd.white)
|
|
67
|
+ self.lcd.textC("Setting temperature...", int(self.lcd.width / 2), int(self.lcd.height / 2), self.lcd.white)
|
68
|
68
|
else:
|
69
|
69
|
draw_graph(self.lcd, self.min, self.temp, self.max)
|
70
|
70
|
|