Skip to content

Commit

Permalink
Attempt to fix incorrect var reading from config (#619)
Browse files Browse the repository at this point in the history
replace str(get_var()) with str(int(get_var())) to correct reading (eg `b'30'` -> `30`)
  • Loading branch information
myfrom authored Apr 8, 2023
1 parent 66525ef commit 8cb0f91
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,27 @@ def get_LUX_TSL2591(TSL_I2C_BUS, TSL_ADDR):
# Set display brightness
if Luxrounded <= int(get_var('LUX_LEVEL_1')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_1')) + " &")
str(int(get_var('DISP_BRIGHTNESS_1'))) + " &")
step = 1
elif Luxrounded > int(get_var('LUX_LEVEL_1')) and Luxrounded < int(get_var('LUX_LEVEL_2')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_2')) + " &")
str(int(get_var('DISP_BRIGHTNESS_2'))) + " &")
step = 2
elif Luxrounded >= int(get_var('LUX_LEVEL_2')) and Luxrounded < int(get_var('LUX_LEVEL_3')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_3')) + " &")
str(int(get_var('DISP_BRIGHTNESS_3'))) + " &")
step = 3
elif Luxrounded >= int(get_var('LUX_LEVEL_3')) and Luxrounded < int(get_var('LUX_LEVEL_4')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_4')) + " &")
str(int(get_var('DISP_BRIGHTNESS_4'))) + " &")
step = 4
elif Luxrounded >= int(get_var('LUX_LEVEL_4')) and Luxrounded < int(get_var('LUX_LEVEL_5')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_5')) + " &")
str(int(get_var('DISP_BRIGHTNESS_5'))) + " &")
step = 5
elif Luxrounded >= int(get_var('LUX_LEVEL_5')):
os.system("crankshaft brightness set " +
str(get_var('DISP_BRIGHTNESS_5')) + " &")
str(int(get_var('DISP_BRIGHTNESS_5'))) + " &")
step = 6

if daynight_gpio == 0:
Expand Down

0 comments on commit 8cb0f91

Please sign in to comment.