mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Update flake8-comprehensions to 3.10.0 (#74882)
This commit is contained in:
parent
70ceccb06a
commit
52130b227e
@ -31,7 +31,7 @@ repos:
|
|||||||
- pyflakes==2.4.0
|
- pyflakes==2.4.0
|
||||||
- flake8-docstrings==1.6.0
|
- flake8-docstrings==1.6.0
|
||||||
- pydocstyle==6.1.1
|
- pydocstyle==6.1.1
|
||||||
- flake8-comprehensions==3.8.0
|
- flake8-comprehensions==3.10.0
|
||||||
- flake8-noqa==1.2.1
|
- flake8-noqa==1.2.1
|
||||||
- mccabe==0.6.1
|
- mccabe==0.6.1
|
||||||
files: ^(homeassistant|script|tests)/.+\.py$
|
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
|
b = X * 0.051713 - Y * 0.121364 + Z * 1.011530
|
||||||
|
|
||||||
# Apply reverse gamma correction.
|
# Apply reverse gamma correction.
|
||||||
r, g, b = map(
|
r, g, b = (
|
||||||
lambda x: (12.92 * x) # type: ignore[no-any-return]
|
12.92 * x if (x <= 0.0031308) else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055)
|
||||||
if (x <= 0.0031308)
|
for x in (r, g, b)
|
||||||
else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
|
|
||||||
[r, g, b],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Bring all negative components to zero.
|
# 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.
|
# If one component is greater than 1, weight components by that value.
|
||||||
max_component = max(r, g, b)
|
max_component = max(r, g, b)
|
||||||
if max_component > 1:
|
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)
|
return (ir, ig, ib)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
bandit==1.7.4
|
bandit==1.7.4
|
||||||
black==22.6.0
|
black==22.6.0
|
||||||
codespell==2.1.0
|
codespell==2.1.0
|
||||||
flake8-comprehensions==3.8.0
|
flake8-comprehensions==3.10.0
|
||||||
flake8-docstrings==1.6.0
|
flake8-docstrings==1.6.0
|
||||||
flake8-noqa==1.2.1
|
flake8-noqa==1.2.1
|
||||||
flake8==4.0.1
|
flake8==4.0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user