Update flake8-comprehensions to 3.10.0 (#74882)
This commit is contained in:
parent
70ceccb06a
commit
52130b227e
3 changed files with 8 additions and 10 deletions
|
@ -31,7 +31,7 @@ repos:
|
|||
- pyflakes==2.4.0
|
||||
- flake8-docstrings==1.6.0
|
||||
- pydocstyle==6.1.1
|
||||
- flake8-comprehensions==3.8.0
|
||||
- flake8-comprehensions==3.10.0
|
||||
- flake8-noqa==1.2.1
|
||||
- mccabe==0.6.1
|
||||
files: ^(homeassistant|script|tests)/.+\.py$
|
||||
|
|
|
@ -294,22 +294,20 @@ def color_xy_brightness_to_RGB(
|
|||
b = X * 0.051713 - Y * 0.121364 + Z * 1.011530
|
||||
|
||||
# Apply reverse gamma correction.
|
||||
r, g, b = map(
|
||||
lambda x: (12.92 * x) # type: ignore[no-any-return]
|
||||
if (x <= 0.0031308)
|
||||
else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
|
||||
[r, g, b],
|
||||
r, g, b = (
|
||||
12.92 * x if (x <= 0.0031308) else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055)
|
||||
for x in (r, g, b)
|
||||
)
|
||||
|
||||
# Bring all negative components to zero.
|
||||
r, g, b = map(lambda x: max(0, x), [r, g, b])
|
||||
r, g, b = (max(0, x) for x in (r, g, b))
|
||||
|
||||
# If one component is greater than 1, weight components by that value.
|
||||
max_component = max(r, g, b)
|
||||
if max_component > 1:
|
||||
r, g, b = map(lambda x: x / max_component, [r, g, b])
|
||||
r, g, b = (x / max_component for x in (r, g, b))
|
||||
|
||||
ir, ig, ib = map(lambda x: int(x * 255), [r, g, b])
|
||||
ir, ig, ib = (int(x * 255) for x in (r, g, b))
|
||||
|
||||
return (ir, ig, ib)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
bandit==1.7.4
|
||||
black==22.6.0
|
||||
codespell==2.1.0
|
||||
flake8-comprehensions==3.8.0
|
||||
flake8-comprehensions==3.10.0
|
||||
flake8-docstrings==1.6.0
|
||||
flake8-noqa==1.2.1
|
||||
flake8==4.0.1
|
||||
|
|
Loading…
Add table
Reference in a new issue