From 599e636468758f9b415b0963eb0f314a88895839 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 18 Oct 2025 10:17:52 -1000 Subject: [PATCH] comment --- esphome/components/light/color_mode.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/light/color_mode.h b/esphome/components/light/color_mode.h index fa3a0aaaac..d9fdc24d35 100644 --- a/esphome/components/light/color_mode.h +++ b/esphome/components/light/color_mode.h @@ -173,6 +173,10 @@ class ColorModeMask { constexpr uint16_t get_mask() const { return this->mask_; } private: + // Using uint16_t instead of uint32_t for more efficient iteration (fewer bits to scan). + // Currently only 10 ColorMode values exist, so 16 bits is sufficient. + // Can be changed to uint32_t if more than 16 color modes are needed in the future. + // Note: Due to struct padding, uint16_t and uint32_t result in same LightTraits size (12 bytes). uint16_t mask_{0}; /// Map ColorMode enum values to bit positions (0-9)