Repository navigation
Conversation
Signed-off-by: jaynis <kranz.jannis@googlemail.com>
for more information, see https://pre-commit.ci
[Low impact] The change affects configuration attributes on Adaptive Lighting's main switch. The PR appears safe to merge, with a non-blocking fix needed to hide saved settings when configuration attributes are disabled. Findings
SummaryAdds
Reviews (1) · Last reviewed commit: "exposing original configuration on switc..." · Reviewed by Greptile |
| extra_state_attributes: dict[str, Any] = {"configuration": self._config} | ||
| extra_state_attributes: dict[str, Any] = { | ||
| "configuration": self._config, | ||
| "original_configuration": self._original_config, |
There was a problem hiding this comment.
Disabled attributes still show settings
After include_config_in_attributes has been enabled, disabling it through change_switch_settings empties configuration but leaves original_configuration fully populated. Users still see their saved settings even though they turned configuration attributes off.
Return an empty dictionary for this attribute while the option is false. Add a regression test that enables then disables the option.
| "original_configuration": self._original_config, | |
| "original_configuration": ( | |
| self._original_config if self._include_config_in_attributes else {} | |
| ), |
Knowledge Base Used: Switches and service controls
…bled Signed-off-by: jaynis <kranz.jannis@googlemail.com>
Adds
original_configurationattribute alongsideconfigurationto preserve the persistent config values. Wheninclude_config_in_attributesis enabled,configurationreflects the live state (updated bychange_switch_settings), whileoriginal_configurationalways shows the persistent baseline from the config flow.Fixes #1649