Basic community fixes PR (#460)

* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
This commit is contained in:
Benjamin Auquite 2023-04-03 03:02:06 -05:00 • committed by GitHub
commit c6a6cd323f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 9 deletions

View file

@ -527,11 +527,18 @@ async def test_manual_control(hass):
await turn_switch(True, entity_id)
assert not manual_control[ENTITY_LIGHT]
# Check that manual control is still enabled if set while bulb is off.
# Test issue #37
await turn_light(False)
await change_manual_control(True)
await turn_light(True)
assert manual_control[ENTITY_LIGHT]
# Check that when 'adapt_brightness' is off, changing the brightness
# doesn't mark it as manually controlled but changing color_temp
# does
await turn_light(False) # reset manually controlled status
await turn_light(True)
await turn_light(False)
await turn_light(True) # reset manually controlled status
assert not manual_control[ENTITY_LIGHT]
await switch.adapt_brightness_switch.async_turn_off()
await turn_light(True, brightness=increased_brightness())