From dbaae667ec560f785334870076c08710ae588f75 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Mon, 10 Feb 2025 11:26:59 +0100 Subject: [PATCH] remove unused incremental increase/decrease of brightness --- include/devices.h | 2 +- include/display.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/devices.h b/include/devices.h index 3d0a1d0..10f28eb 100644 --- a/include/devices.h +++ b/include/devices.h @@ -39,7 +39,7 @@ namespace Devices { [](const char* msg) { Display::brightness = String{ msg }.toInt(); } - }).withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(Display::Brightness::STEP).restoreStateFromCommand().build(); + }).withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(1).restoreStateFromCommand().build(); auto hourFormatMqtt = Builder::instance(new Switch{ "Format 24h", "format_24h", [](const char* msg) { diff --git a/include/display.h b/include/display.h index b2b5c2c..cfbccf8 100644 --- a/include/display.h +++ b/include/display.h @@ -60,7 +60,6 @@ namespace Display { struct Brightness { static constexpr uint8 MIN = 0; static constexpr uint8 MAX = 15; - static constexpr uint8 STEP = 1; static constexpr uint8 DAY = 11; static constexpr uint8 NIGHT = MIN; void (*changedCallback)(); @@ -75,10 +74,6 @@ namespace Display { return current; } - void change(bool increase) { - increase ? *this = current + STEP : *this = current - STEP; - } - private: uint8 current = NIGHT; } brightness;