Skip to content

Commit

Permalink
DST manual support
Browse files Browse the repository at this point in the history
Still not automatic handling
  • Loading branch information
Veltys committed May 16, 2024
1 parent 35addc0 commit e380035
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/config_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
@brief : Config class
@author : Veltys
@date : 2023-12-18
@version : 1.4.0
@date : 2024-05-16
@version : 1.5.0
@usage : (imported when needed)
@note : ...
'''


class config(object):
buttons_pins = [15, 17]
dst = True
# leds_pins = ['LED']
dht11_pins = [2, 13]
dht22_pins = [4]
Expand Down
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
@brief : Main module
@author : Veltys
@date : 2023-12-27
@version : 2.5.1
@date : 2024-05-16
@version : 2.6.0
@usage : python3 main.py | ./main.py
@note : ...
'''
Expand Down Expand Up @@ -246,7 +246,7 @@ def paint_screen(oled, wifi_image, server_image, thermometer_image, temperature,

position_v += 1

oled.text('PicoTemp 2.5.0 M', int((128 - 16 * 8) / 2), position_v * (TEXT_HEIGHT + OFFSET_V) + RECT_HEIGHT + OFFSET_V, oled.white)
oled.text('PicoTemp 2.6.0 M', int((128 - 16 * 8) / 2), position_v * (TEXT_HEIGHT + OFFSET_V) + RECT_HEIGHT + OFFSET_V, oled.white)

oled.show()

Expand Down Expand Up @@ -326,7 +326,7 @@ def screen_buttons_manager():
thermometer_image = image_thermometer
get_temp_hum = get_temperature_humidity()
temperature, humidity = get_temp_hum(i, total_ticks)
now = time.localtime(time.time() + HOUR_OFFSET) if(i % 100 == 0) else now # TODO: DST handling
now = time.localtime(time.time() + HOUR_OFFSET + (HOUR_OFFSET if config.dst else 0)) if(i % 100 == 0) else now # TODO: DST handling still needed
now_text = f"{ '{:0>2}'.format(now[3]) }:{ '{:0>2}'.format(now[4]) } { '{:0>2}'.format(now[2]) }/{ '{:0>2}'.format(now[1]) }/{ now[0] }" if i % 6 in (0, 1, 2) else f"{ '{:0>2}'.format(now[3]) } { '{:0>2}'.format(now[4]) } { '{:0>2}'.format(now[2]) }/{ '{:0>2}'.format(now[1]) }/{ now[0] }"
uptime = determine_uptime() if(i % 2 == 0) else uptime

Expand Down

0 comments on commit e380035

Please sign in to comment.