-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Fix supported features in Assist Satellite #148561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,12 +117,9 @@ def _validate_supported_feature(supported_feature: str) -> int: | |
raise vol.Invalid(f"Unknown supported feature '{supported_feature}'") from exc | ||
|
||
|
||
def _validate_supported_features(supported_features: int | list[str]) -> int: | ||
def _validate_supported_features(supported_features: list[str]) -> int: | ||
"""Validate a supported feature and resolve an enum string to its value.""" | ||
|
||
if isinstance(supported_features, int): | ||
return supported_features | ||
|
||
feature_mask = 0 | ||
|
||
for supported_feature in supported_features: | ||
|
@@ -154,7 +151,7 @@ class BaseSelectorConfig(TypedDict, total=False): | |
vol.Optional("device_class"): vol.All(cv.ensure_list, [str]), | ||
# Features supported by the entity | ||
vol.Optional("supported_features"): [ | ||
vol.All(cv.ensure_list, [str], _validate_supported_features) | ||
vol.Any(int, vol.All(cv.ensure_list, [str], _validate_supported_features)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we accept integers and not rely on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is run in two different contexts:
So as a result this check (and therefore translation of feature names) is run and does work for a Entity selectors are quite rare though, the only ones with supported features and therefore affected by this bug are this one and An alternative fix would be to run the check fully for all fields for all services also during runtime. Yet another alternative would be to switch those two affected services to use a target selector. |
||
], | ||
} | ||
) | ||
|
Uh oh!
There was an error while loading. Please reload this page.