Files
core/tests/components
TheJulianJES bae5a3dbd6 Fix ZHA turn_on issues with transition=0, improve tests (#97539)
* Fix turn_on ignoring transition=0 and brightness=None, add test

This fixes light.turn_on for ZHA lights ignoring a transition of 0 when no brightness is given at the same time.
It also adds a test for that case.

Fixes https://github.com/home-assistant/core/issues/93265

* Add test for "force on" lights

This test checks that "force on" lights also get an "on" command (in addition to the "move to level" command) when turn_on is called with only transition=0.

* Fix "on" command sent for transition=0 calls, fix FORCE_ON missing for transition=0

This fixes an issue where the "on" command is sent in addition to a "move_to_level_with_on_off" command, even though the latter one is enough (for non-FORCE_ON lights).
It also fixes the test to not expect the unnecessary "on" command (in addition to the expected "move_to_level_with_on_off" command).

The `brightness != 0` change is needed to fix an issue where FORCE_ON lights did not get the required "on" command (in addition to "move_to_level_with_on_off") if turn_on was called with only transition=0.
(It could have been `brightness not None`, but that would also send an "on" command if turn_on is called with brightness=0 which HA somewhat "supports". The brightness != 0 check avoids that issue.)

* Improve comments in ZHA light class
2023-08-03 15:20:40 -04:00
..
2023-03-28 14:59:03 +02:00
2023-02-02 18:35:24 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-05-04 11:25:35 +02:00
2023-02-15 12:39:12 +01:00
2023-02-15 14:09:50 +01:00
2023-04-30 20:34:57 +02:00
2023-05-29 23:24:15 +02:00
2023-07-18 18:51:02 +02:00
2023-02-15 14:09:50 +01:00
2023-04-25 15:40:46 +02:00
2023-03-02 12:33:04 +01:00
2023-07-21 12:16:35 +02:00
2023-05-04 11:25:35 +02:00
2023-02-02 18:35:24 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 16:46:03 -05:00
2023-07-27 16:58:09 +02:00
2023-07-09 17:37:32 -05:00
2023-02-15 14:09:50 +01:00
2023-07-25 11:04:05 +02:00
2023-02-09 13:41:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-04-06 13:48:19 +02:00
2023-02-15 14:09:50 +01:00
2023-02-22 10:18:58 +01:00
2023-03-28 08:46:16 +02:00
2023-05-26 15:20:46 +02:00
2023-02-15 12:39:12 +01:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00
2023-07-17 09:27:01 +02:00
2023-07-06 23:05:46 +02:00
2023-02-15 14:09:50 +01:00
2023-04-29 11:18:16 +02:00
2023-02-15 14:09:50 +01:00
2023-06-25 09:00:52 -05:00
2023-02-15 14:09:50 +01:00
2023-02-22 13:55:44 +01:00
2023-06-27 17:42:27 +02:00
2023-02-15 14:09:50 +01:00
2023-05-04 11:25:35 +02:00
2023-03-22 20:00:47 -04:00
2023-03-28 11:54:16 +02:00
2023-07-09 13:55:10 -04:00
2023-02-15 14:09:50 +01:00
2023-07-11 18:24:40 +02:00
2023-07-21 08:55:44 +02:00
2023-01-27 09:09:46 +01:00
2023-06-23 11:32:20 +02:00
2023-04-12 23:47:37 +02:00
2023-07-23 22:00:26 +02:00
2023-02-17 21:08:18 -05:00
2023-04-30 22:33:51 +02:00
2023-03-22 20:00:47 -04:00
2023-02-15 14:09:50 +01:00
2023-06-08 23:43:56 +02:00
2023-04-20 08:42:22 -10:00
2023-01-30 14:06:52 +01:00
2023-03-26 20:03:03 +02:00
2023-02-15 14:09:50 +01:00
2023-02-15 14:09:50 +01:00