From 61ffe2abed7fb14f427f49d61d0381b2481d05b9 Mon Sep 17 00:00:00 2001 From: mergen3107 <6279855+mergen3107@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:31:43 -0500 Subject: [PATCH] Disable irrelevant plugins on devices with no frontlight (#12766) Closes #12764 --- plugins/autodim.koplugin/main.lua | 5 +++++ plugins/autowarmth.koplugin/_meta.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/autodim.koplugin/main.lua b/plugins/autodim.koplugin/main.lua index 7da0107fd..993e5c12f 100644 --- a/plugins/autodim.koplugin/main.lua +++ b/plugins/autodim.koplugin/main.lua @@ -5,6 +5,11 @@ Plugin for automatic dimming of the frontlight after an idle period. --]]-- local Device = require("device") + +if not Device:hasFrontlight() then + return { disabled = true, } +end + local FFIUtil = require("ffi/util") local SpinWidget = require("ui/widget/spinwidget") local UIManager = require("ui/uimanager") diff --git a/plugins/autowarmth.koplugin/_meta.lua b/plugins/autowarmth.koplugin/_meta.lua index 78b82fcda..2025bee7b 100644 --- a/plugins/autowarmth.koplugin/_meta.lua +++ b/plugins/autowarmth.koplugin/_meta.lua @@ -2,5 +2,5 @@ local _ = require("gettext") return { name = "autowarmth", fullname = require("device"):hasNaturalLight() and _("Auto warmth and night mode") or _("Auto night mode"), - description = _([[This plugin allows to set the frontlight warmth automagically.]]), + description = require("device"):hasNaturalLight() and _([[This plugin allows to set the frontlight warmth and night mode automagically.]]) or _([[This plugin allows to enable night mode automagically.]]), }