Skip to content
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

Address late review on readability sensor code #87111

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/sensor/__init__.py
Expand Up @@ -259,7 +259,9 @@ def _numeric_state_expected(self) -> bool:
return True
# Sensors with custom device classes are not considered numeric
device_class = try_parse_enum(SensorDeviceClass, self.device_class)
return not (device_class is None or device_class in NON_NUMERIC_DEVICE_CLASSES)
return (
device_class is not None and device_class not in NON_NUMERIC_DEVICE_CLASSES
)
jbouwh marked this conversation as resolved.
Show resolved Hide resolved

@property
def options(self) -> list[str] | None:
Expand Down