Disable irrelevant plugins on devices with no frontlight (#12766)

Closes #12764
This commit is contained in:
mergen3107
2024-11-21 13:31:43 -05:00
committed by GitHub
parent 0e2dadf6e0
commit 61ffe2abed
2 changed files with 6 additions and 1 deletions

View File

@@ -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")

View File

@@ -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.]]),
}