Repository navigation
Fix light color mode on HA 2026.6+ (#759) - #812
Closed
Arelion999 wants to merge 1 commit into
Closed
Arelion999 wants to merge 1 commit into
Arelion999 wants to merge 1 commit into
Conversation
color_mode=None is no longer resolved by HA from the entity attributes, the entity fails to be added with "does not report a color mode". Set an explicit mode from the supported set instead. Also keep the brightness/onoff mode when the color capability has scenes only: modes stays empty and supported_color_modes must not be.
Owner
|
Поправил иначе тут 71cf4b3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Продолжение #759. После 3.22.0 старая ошибка ушла, но на HA 2026.6.4 сущность цветной лампы по-прежнему не создаётся — просто с другим текстом:
Причина —
self._attr_color_mode = Noneв концеinternal_init. Раньше это означало «HA, выведи режим сам по атрибутам», но в свежих версиях этот путь убран: еслиsupported_color_modesзаполнен,color_modeобязан быть одним из режимов набора.В PR ставится явный режим из набора,
COLOR_TEMPв приоритете. Значение стартовое:internal_updateдальше переставляет режим наHSилиCOLOR_TEMPпо фактическому состоянию устройства.Проверка
if modes:заодно закрывает второй случай. Сейчасmodesсоздаётся внутриif color:и там же присваивается вsupported_color_modes. Если у устройства вcolorесть толькоscenes— безpaletteи безtemperature_k— набор останется пустым, и сущность не создастся уже из-за пустогоsupported_color_modes. С проверкой в этом случае остаётся режимbrightness/onoff, выставленный выше.Проверено на светодиодной ленте Яндекса (палитра + температура), HA 2026.6.4: сущность создаётся,
color_mode=color_temp,supported_color_modes=[color_temp, hs], включение и выключение работают и из HA, и голосом. Устройства со сценами без палитры проверить не на чем — там правка безопасна логически, но вживую я её не гонял.