Files
core/homeassistant/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-08-03 14:31:49 +03:00
2023-07-08 08:59:34 +02:00
2023-05-25 10:45:15 +02:00
2023-07-20 22:20:15 +02:00
2023-07-09 10:10:23 -04:00
2023-07-23 22:00:26 +02:00
2023-07-05 08:35:02 +02:00
2023-07-22 23:03:45 +02:00
2023-05-28 08:52:52 +02:00
2023-07-18 18:51:02 +02:00
2023-07-08 07:30:54 -10:00
2023-06-23 00:00:27 +02:00
2023-04-28 14:30:10 +02:00
2023-07-12 22:00:05 -04:00
2023-07-22 13:07:34 +02:00
2023-07-23 22:00:26 +02:00
2023-05-11 08:54:51 +02:00
2023-07-27 23:01:17 +02:00
2023-07-30 18:40:38 +02:00
2023-06-22 09:35:53 +02:00
2023-07-17 10:20:57 +02:00
2023-07-22 23:03:45 +02:00
2023-08-01 09:49:20 +02:00
2023-07-18 20:57:41 +02:00
2023-07-25 11:04:05 +02:00
2023-06-21 16:12:51 +02:00
2023-07-27 08:58:52 +02:00
2023-07-20 13:16:08 -05:00
2023-03-28 08:46:16 +02:00
2023-08-03 14:34:20 +03:00
2023-07-14 21:24:41 +02:00
2023-06-15 21:15:33 -04:00
2023-04-07 12:13:39 +02:00
2023-08-03 20:07:44 +02:00
2023-07-22 23:03:45 +02:00
2023-04-20 19:27:44 +02:00
2023-07-24 13:18:38 +02:00
2023-07-23 22:00:26 +02:00
2023-07-08 07:30:54 -10:00
2023-07-08 07:30:54 -10:00
2023-07-23 22:00:26 +02:00
2023-07-28 11:52:23 +02:00
2023-06-23 11:37:52 +02:00
2023-06-14 16:52:43 +02:00
2023-04-12 23:47:37 +02:00
2023-07-30 18:40:38 +02:00
2023-07-22 23:03:45 +02:00
2023-07-22 23:03:45 +02:00
2023-07-22 17:39:11 +02:00
2023-06-19 11:51:04 +02:00
2023-07-22 16:33:06 +02:00
2023-07-23 21:40:56 +02:00
2023-06-08 23:43:56 +02:00
2023-06-06 20:55:25 -04:00
2023-08-01 10:08:08 +02:00
2023-06-21 18:10:30 +02:00
2023-06-08 22:46:04 +02:00
2023-07-25 08:30:16 +02:00
2023-08-03 18:57:34 +02:00