From 93eec1ac6c8de691511a69235f8b072619d39a19 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 30 Dec 2024 10:08:48 +1100 Subject: Set the min brightness setting to 20% This is quite dim, but also slightly higher than the 'screensaver' brightness in #127. --- lua/settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/settings.lua') diff --git a/lua/settings.lua b/lua/settings.lua index f2a1ec7e..8547aa19 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -290,7 +290,7 @@ settings.DisplaySettings = SettingsScreen:new { local brightness = self.content:Slider { w = lvgl.PCT(100), - range = { min = 0, max = 100 }, + range = { min = 20, max = 100 }, value = display.brightness:get(), } brightness:onevent(lvgl.EVENT.VALUE_CHANGED, function() -- cgit v1.2.3 From ff87c9217577783b60ee4cf466a3c59777a2fc40 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Fri, 27 Dec 2024 23:23:49 -0800 Subject: Write settings to nvs when changing from the setting screen Otherwise, settings may not actually be saved if the device crashes/ reboots unexpectedly. Fixes #148 --- lua/settings.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua/settings.lua') diff --git a/lua/settings.lua b/lua/settings.lua index 8547aa19..9018d884 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -13,6 +13,7 @@ local usb = require("usb") local font = require("font") local main_menu = require("main_menu") local img = require("images") +local nvs = require("nvs") local settings = {} @@ -33,6 +34,9 @@ local SettingsScreen = widgets.MenuScreen:new { pad_left = 4, pad_right = 4, } + end, + on_hide = function(self) + nvs.write(); end } -- cgit v1.2.3