Fix adaptive_lighting.change_switch_settings service (#712)

* Fix adaptive_lighting.change_switch_settings service

Closes #623

* filter defaults

* fix mutable

* Revert debugging logs
This commit is contained in:
Bas Nijholt 2023-08-06 11:15:14 -07:00 committed by GitHub
commit cb9ae39ee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View file

@ -1353,6 +1353,12 @@ async def test_change_switch_settings_service(hass):
await change_switch_settings(**{CONF_USE_DEFAULTS: "current"})
assert switch._sun_light_settings.min_color_temp == 2000
# testing with "configuration" and setting a new value
await change_switch_settings(
**{CONF_USE_DEFAULTS: "configuration", CONF_MIN_COLOR_TEMP: 3000}
)
assert switch._sun_light_settings.min_color_temp == 3000
# testing with "configuration" should revert back to 2500
await change_switch_settings(**{CONF_USE_DEFAULTS: "configuration"})
assert switch._sun_light_settings.min_color_temp == 2500