Use assignment expressions 20 (#57969)

This commit is contained in:
Marc Mueller 2021-10-20 20:31:00 +02:00 committed by GitHub
parent 398061706c
commit 487fa0a905
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 29 additions and 52 deletions

View file

@ -481,8 +481,7 @@ class Light(BaseLight, ZhaEntity):
attributes, from_cache=False
)
color_mode = results.get("color_mode")
if color_mode is not None:
if (color_mode := results.get("color_mode")) is not None:
if color_mode == LightColorMode.COLOR_TEMP:
color_temp = results.get("color_temperature")
if color_temp is not None and color_mode: