Set Brightness Command Requiring 2 Runs #390
-
Hi all, I am writing a basic script to set the brightness of my lights. I will be able to set the brightness level of a specific room without calling the light.turn_on command in Home Assistant. To test this, I have a print statement to indicate that the correct light entity is set to the correct brightness level. I'm not sure why, although I need to execute this code twice for the brightness level to change.
When executed, the output indicates that the brightness level is set to the previous level, 25, set in a previous test: When executed again, the output indicates that the brightness level is set to the actual level, 60: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Are you sure it is not changing the brightness? Regarding to to reported values, you need to perform an |
Beta Was this translation helpful? Give feedback.
Are you sure it is not changing the brightness? Regarding to to reported values, you need to perform an
update()
to obtain the new values after the change as information returned by properties is cached (see https://python-kasa.readthedocs.io/en/latest/smartdevice.html#smartdevice-class and https://python-kasa.readthedocs.io/en/latest/design.html#update-cycle).