Skip to content

Commit

Permalink
Chenged pool temperature reading and added sleep for clean start
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavouk106 committed Jun 19, 2022
1 parent 79d3590 commit 9d02835
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def window_main(window_type, mouse_click):
display.blit(TextSurf, TextRect)

# Button for water heating + text on it
button_on_off(0, u"Ohřev vody", u"(" + str(temp_values[4]) + "/" + str(temp_values[5]) + " " + u"\u00b0" + "C)", white, main_temp_vertical_divider + border, 0 + border, 130, 45, red_dark, red, green_dark, green)
button_on_off(0, u"Ohřev vody", str(temp_values[4]) + "/" + str(temp_values[5]) + " " + u"\u00b0" + "C", white, main_temp_vertical_divider + border, 0 + border, 130, 45, red_dark, red, green_dark, green)

# Button for heating
if heating_time_end != heating_time:
Expand All @@ -289,19 +289,24 @@ def window_main(window_type, mouse_click):
seconds = "0" + str(seconds)
else:
seconds = str(seconds)
heating_time_show = "(" + minutes + ":" + seconds + ")"
heating_time_show = minutes + ":" + seconds
else:
minutes = str(int(heating_time / 60))
seconds = heating_time % 60
if seconds < 10:
seconds = "0" + str(seconds)
else:
seconds = str(seconds)
heating_time_show = "(" + minutes + ":" + seconds + ")"
heating_time_show = minutes + ":" + seconds
button_on_off(1, u"Ruční topení", heating_time_show, white, main_temp_vertical_divider + border, 0 + border + 35 + border, 130, 45, red_dark, red, green_dark, green)

# Button for pool
button_on_off(2, u"Bazén", u"(" + str(pool_temp_values[0]) + "/" + str(pool_temp_values[1]) + " " + u"\u00b0" + "C)", white, main_temp_vertical_divider + border, 0 + border + 35 + border + 35 + border, 130, 45, red_dark, red, green_dark, green)
if float(pool_temp_values[1]) - float(pool_temp_values[0]) >= 0:
temp_string = str(pool_temp_values[0]) + u"\u00b0" + "C (+" + str(float(pool_temp_values[1]) - float( pool_temp_values[0])) + ")"
else:
temp_string = str(pool_temp_values[0]) + u"\u00b0" + "C (-" + str(abs(float(pool_temp_values[1]) - float( pool_temp_values[0]))) + ")"
# temp_string = str(pool_temp_values[0]) + u"(" + "-" + str(abs(float(pool_temp_values[1]) - float( pool_temp_values[0]))) + " " + u"\u00b0" + "C)"
button_on_off(2, u"Bazén", temp_string, white, main_temp_vertical_divider + border, 0 + border + 35 + border + 35 + border, 130, 45, red_dark, red, green_dark, green)

# Compass for wind direction and speed
pygame.draw.circle(display, white, (main_temp_vertical_divider + border + 65, 0 + border + 70 + border + 70 + border + 45), 45 , 2)
Expand Down Expand Up @@ -340,6 +345,7 @@ def window_main(window_type, mouse_click):

pygame.display.update();

time.sleep(10)

while True:
# global x, y, heating_time, heating_time_end
Expand Down

0 comments on commit 9d02835

Please sign in to comment.