1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update light intents to check supported_color_modes (#50625)

This commit is contained in:
Erik Montnemery
2021-05-14 23:23:29 +02:00
committed by GitHub
parent 9c5f1b4406
commit bcd8f43e7b
3 changed files with 33 additions and 12 deletions

View File

@@ -119,7 +119,7 @@ def async_match_state(
@callback
def async_test_feature(state: State, feature: int, feature_name: str) -> None:
"""Test is state supports a feature."""
"""Test if state supports a feature."""
if state.attributes.get(ATTR_SUPPORTED_FEATURES, 0) & feature == 0:
raise IntentHandleError(f"Entity {state.name} does not support {feature_name}")